p.setValidatedId(verified.getIdentifier());
AuthSuccess authSuccess = (AuthSuccess) verification
.getAuthResponse();
if (authSuccess.hasExtension(AxMessage.OPENID_NS_AX)) {
FetchResponse fetchResp = (FetchResponse) authSuccess
.getExtension(AxMessage.OPENID_NS_AX);
p.setEmail(fetchResp.getAttributeValue("email"));
p.setFirstName(fetchResp.getAttributeValue("firstname"));
p.setLastName(fetchResp.getAttributeValue("lastname"));
p.setFullName(fetchResp.getAttributeValue("fullname"));
// also use the ax namespace for compatibility
if (p.getEmail() == null) {
p.setEmail(fetchResp.getAttributeValue("emailax"));
}
if (p.getFirstName() == null) {
p.setFirstName(fetchResp
.getAttributeValue("firstnameax"));
}
if (p.getLastName() == null) {
p.setLastName(fetchResp.getAttributeValue("lastnameax"));
}
if (p.getFullName() == null) {
p.setFullName(fetchResp.getAttributeValue("fullnameax"));
}
}
userProfile = p;
return p;