mode = response.getParameterValue(IdentityConstants.OpenId.ATTR_MODE);
if (mode != null && IdentityConstants.OpenId.CANCEL.equals(mode)) {
// User has denied sending his profile info :(
throw new IdentityException("User has denied sending his profile info");
}
authSuccess = (AuthSuccess) verifyOpenID(request, response);
claimList = new ArrayList<ClaimDTO>();
for (Object alias : authSuccess.getExtensions()) {
extension = OpenIDExtensionFactory.getInstance().getExtension((String) alias,
authSuccess);
if (extension != null)
extension.setSessionAttributes(claimList);
}
openID = new OpenIDDTO();
openID.setOpenID(authSuccess.getIdentity());
openID.setClaims(claimList.toArray(new ClaimDTO[claimList.size()]));
return openID;
} catch (OpenIDException e) {
log.error(e.getMessage());
// Present error to the user.
throw new IdentityException("OpenID authentication failed", e);
}
}