Issue trying to get user email address with Sample ConsumerServlet

25 views
Skip to first unread message

Maru

unread,
Sep 16, 2009, 11:30:54 AM9/16/09
to OpenID4Java
When using the ConsumerServlet sample under \samples\consumer-servlet
the authentication works great but I can't get the provider to return
the email address back to me. I'm testing with Google:
https://www.google.com/accounts/o8/id and I tested other sites running
OpenID and they can get my email address authenticating with Google
which means they do provide it.

I read the OpenID documentation and it seems you're sending the
correct information in the library but nothing is coming back.

Any ideas?

Thanks
Maria

Breno

unread,
Sep 17, 2009, 3:19:00 AM9/17/09
to openi...@googlegroups.com
Maru,

Could you post an example of a request issued by the example consumer servlet?

Breno (Google)
--
Breno de Medeiros

Max Wegmueller

unread,
Oct 7, 2009, 10:31:28 AM10/7/09
to OpenID4Java
Hi,

I have a similar problem to get the user name, email does work.

When I use the ConsumerServlet.java and want to get user attributes
from googles openid:
using: https://www.google.com/accounts/o8/id

modify ConsumerServlet.authRequest(..) {
..
openid.ax.type.firstname
fetch.addAttribute("email", "http://axschema.org/contact/email",
true);
authReq.addExtension(fetch);
..
}

The code from above does work to get the users email address back.
But as soon I want as well to receive the users first- and last name,
I get errors.

I think I set the fetch attributes correct, according googles
documentation: http://code.google.com/apis/accounts/docs/OpenID.html#Parameters
fetch.addAttribute("firstname", "http://axschema.org/namePerson/
first", true);
fetch.addAttribute("lastname", "http://axschema.org/namePerson/last",
true);

Is anyone able, to retrieve the users first- and last name from google
through OpenID Attribute Exchange 1.0?

Errors:
[#|2009-10-07T14:15:09.659+0000|WARNING|sun-appserver2.1|
javax.enterprise.system.stream.err|
_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-1;_RequestID=f560b1d1-4d2b-4d52-
ab34-ac6a5a1876b4;|
[INFO] ConsumerManager - Found association: AOQobUdyJhxNLVY-
uPhHQgKMk35k4QfGZwM9N0TwdNzS7pXeRLQ25gYssaAQfYYyF4PkRicG verifying
signature locally...|#]

[#|2009-10-07T14:15:09.659+0000|WARNING|sun-appserver2.1|
javax.enterprise.system.stream.err|
_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-1;_RequestID=f560b1d1-4d2b-4d52-
ab34-ac6a5a1876b4;|
[INFO] ConsumerManager - Local signature verification failed.|#]

[#|2009-10-07T14:15:09.660+0000|WARNING|sun-appserver2.1|
javax.enterprise.system.stream.err|
_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-1;_RequestID=f560b1d1-4d2b-4d52-
ab34-ac6a5a1876b4;|
[INFO] ConsumerManager - Verification failed for:
https://www.google.com/accounts/o8/id?id=AItOawnEVrxwi3jpttAqksWJvre6ZYrEBMo3ayU
reason: Local signature verification failed|#]

Requests:

POST https://www.google.com/accounts/o8/ud
openid.assoc_handle AOQobUdyJhxNLVY-
uPhHQgKMk35k4QfGZwM9N0TwdNzS7pXeRLQ25gYssaAQfYYyF4PkRicG
openid.ax.mode fetch_request
openid.ax.required firstname,lastname,email
openid.ax.type.email http://axschema.org/contact/email
openid.ax.type.firstname http://axschema.org/namePerson/first
openid.ax.type.lastname http://axschema.org/namePerson/last
openid.claimed_id http://specs.openid.net/auth/2.0/identifier_select
openid.identity http://specs.openid.net/auth/2.0/identifier_select
openid.mode checkid_setup
openid.ns http://specs.openid.net/auth/2.0
openid.ns.ax http://openid.net/srv/ax/1.0
openid.realm http://localhost:8080/ceq-ws/consumer?is_return=true
openid.return_to http://localhost:8080/ceq-ws/consumer?is_return=true

Response Headers
Location
http://localhost:8080/ceq-ws/consumer?is_return=true&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.mode=id_res&openid.op_endpoint=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fud&openid.response_nonce=2009-10-07T14%3A20%3A16Z1z85BddvKR8gUg&openid.return_to=http%3A%2F%2Flocalhost%3A8080%2Fceq-ws%2Fconsumer%3Fis_return%3Dtrue&openid.assoc_handle=AOQobUdyJhxNLVY-uPhHQgKMk35k4QfGZwM9N0TwdNzS7pXeRLQ25gYssaAQfYYyF4PkRicG&openid.signed=op_endpoint%2Cclaimed_id%2Cidentity%2Creturn_to%2Cresponse_nonce%2Cassoc_handle%2Cns.ext1%2Cext1.mode%2Cext1.type.firstname%2Cext1.value.firstname%2Cext1.type.email%2Cext1.value.email%2Cext1.type.lastname%2Cext1.value.lastname&openid.sig=Fa0wrz8sLDxGBgkBNDzOiIJ5PxA5Msddl%2FCHI3xG1Dg%3D&openid.identity=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3DAItOawnEVrxwi3jpttAqksWJvre6ZYrEBMo3ayU&openid.claimed_id=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3DAItOawnEVrxwi3jpttAqksWJvre6ZYrEBMo3ayU&openid.ns.ext1=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0&openid.ext1.mode=fetch_response&openid.ext1.type.firstname=http%3A%2F%2Faxschema.org%2FnamePerson%2Ffirst&openid.ext1.value.firstname=Max&openid.ext1.type.email=http%3A%2F%2Faxschema.org%2Fcontact%2Femail&openid.ext1.value.email=wegmueller%40gmail.com&openid.ext1.type.lastname=http%3A%2F%2Faxschema.org%2FnamePerson%2Flast&openid.ext1.value.lastname=Wegm%C3%BCller

Breno

unread,
Oct 12, 2009, 2:46:22 PM10/12/09
to openi...@googlegroups.com
Your response indicates that the Google Accounts OP is sending the requested information. They are even included in the signature. I am not sure why you cannot parse it.
--
Breno de Medeiros

Reply all
Reply to author
Forward
0 new messages