if (queryString != null && queryString.length() > 0)
receivingURL.append("?").append(queryString);
// verify the response; ConsumerManager needs to be the same
// (static) instance used to place the authentication request
VerificationResult verification = openIdConsumerManager.verify(
receivingURL.toString(), parameterList, discovered);
// examine the verification result and extract the verified identifier
Identifier identifier = verification.getVerifiedId();
if (identifier != null) {
AuthSuccess authSuccess = (AuthSuccess) verification.getAuthResponse();
Map<String, List<String>> attributeValues = null;
if (authSuccess.hasExtension(AxMessage.OPENID_NS_AX)) {
FetchResponse fetchResp = (FetchResponse) authSuccess.getExtension(AxMessage.OPENID_NS_AX);
@SuppressWarnings("unchecked")
Map<String, List<String>> attrValues = fetchResp.getAttributes();
attributeValues = attrValues;
}
OpenIdPrincipal principal = createPrincipal(identifier.getIdentifier(),
discovered.getOPEndpoint(), attributeValues);
openIdRelyingPartySpi.get().loginSucceeded(principal,
responseHandler.createResponseHolder(httpResponse));
} else {
openIdRelyingPartySpi.get().loginFailed(verification.getStatusMsg(),
responseHandler.createResponseHolder(httpResponse));
}
} catch (OpenIDException e) {
responseHandler.sendError(HttpServletResponse.SC_BAD_REQUEST, e.getMessage(), httpResponse);
return;