As the question says :)
This is the request I made using openid4java:
DiscoveryInformation discovered = manager.associate(discoveries);
System.out.println("discovered");
// store the discovery information in the user's session
session.setAttribute("openid-disco", discovered);
// obtain a AuthRequest message to be sent to the OpenID provider
AuthRequest authReq = manager.authenticate(discovered, returnToUrl);
System.out.println("authReq Ok");
// Attribute Exchange example: fetching the 'email' attribute
FetchRequest fetch = FetchRequest.createFetchRequest();
System.out.println("fetch");
fetch.addAttribute("gender", // attribute alias
"http://schema.openid.net/gender", // type URI
true);
fetch.addAttribute("email",
"http://schema.openid.net/contact/email",
true);
fetch.addAttribute("first",
"namePerson/first",
true);
// attach the extension to the authentication request
authReq.addExtension(fetch);
And this is the response I receive. As you notice, first name and gender count are 0:
openid.assoc_handle={HMAC-SHA256}{4f156b67}{jEurHw%3D%3D}&
openid.ax.count.email=1
&openid.ax.count.first=0
&openid.ax.count.gender=0
&openid.ax.mode=fetch_response&
openid.ax.type.email=http%3A%2F%2Fschema.openid.net%2Fcontact%2Femail&
openid.ax.type.first=namePerson%2Ffirst&
openid.ax.type.gender=http%3A%2F%2Fschema.openid.net%2Fgender
&openid.ax.value.email.1=saad.alothman%40gmail.com
&openid.claimed_id=http%3A%2F%2Fsaad-alothman.myopenid.com%2F
&openid.identity=http%3A%2F%2Fsaad-alothman.myopenid.com%2F
&openid.mode=id_res
&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0
&openid.ns.ax=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0
&openid.op_endpoint=http%3A%2F%2Fwww.myopenid.com%2Fserver&
openid.response_nonce=2012-01-17T14%3A32%3A26ZvN5JP4
&openid.return_to=https%3A%2F%2F192.168.133.17%3A10029%2Fwps%2FPA_openIdTest%2Fconsumer_returnurl.jsp
&openid.sig=8%2FES2uury7SxehrYVlH9gef9pB3l1eNQzCLqFJDTXDk%3D&
I tried myopenid and gmail as providers but it only sends the email. From the provider page when my page redirects, it shows only the email as the one thing that has been required by me in the code, but I have added the name and gender.
I would like to get info other than the email like name, gender, and DOB.
Upadte: i used sreg extension object and i have got three values (name,email,nickname) however is still want to be able to get the other values like address ...