return discovered;
}
}
// stateless, bare response, or the user changed the ID at the OP
DiscoveryInformation firstServiceMatch = null;
// perform discovery on the claim identifier in the assertion
if(DEBUG) _log.debug(
"Performing discovery on the ClaimedID in the assertion: "
+ respClaimed);
List discoveries = _discovery.discover(respClaimed);
// find the newly discovered service endpoint that matches the assertion
// - OP endpoint, OP-specific ID and protocol version must match
// - prefer (first = highest priority) endpoint with an association
if (DEBUG)
_log.debug("Looking for a service element to match " +
"the ClaimedID and OP endpoint in the assertion...");
Iterator iter = discoveries.iterator();
while (iter.hasNext())
{
DiscoveryInformation service = (DiscoveryInformation) iter.next();
if (DiscoveryInformation.OPENID2_OP.equals(service.getVersion()))
continue;
String opSpecific = service.hasDelegateIdentifier() ?
service.getDelegateIdentifier() :
service.getClaimedIdentifier().getIdentifier();
if ( ! opSpecific.equals(assertId) ||
! service.isVersion2() ||
! service.getIdpEndpoint().toString().equals(respEndpoint) )
continue;
// keep the first endpoint that matches
if (firstServiceMatch == null)
{
if (DEBUG) _log.debug("Found matching service: " + service);
firstServiceMatch = service;
}
Association assoc = _associations.load(
service.getIdpEndpoint().toString(),
authResp.getHandle());
// don't look further if there is an association with this endpoint
if (assoc != null)
{