jmpcn / openid4java

Automatically exported from code.google.com/p/openid4java
Apache License 2.0
0 stars 0 forks source link

Google authentication works yahoo is failing #154

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
FetchRequest fetch = FetchRequest.createFetchRequest();
                if (userSuppliedString.startsWith(GOOGLE_ENDPOINT)) {
                        fetch.addAttribute("email", "http://axschema.org/contact/email", true);
                        fetch.addAttribute("firstName", "http://axschema.org/namePerson/first", true);
                        fetch.addAttribute("lastName", "http://axschema.org/namePerson/last", true);
                } else if (userSuppliedString.startsWith(YAHOO_ENDPOINT)) {
                        fetch.addAttribute("email", "http://axschema.org/contact/email", true);
                        fetch.addAttribute("fullname", "http://axschema.org/namePerson", true);
                } else {
                        // works for myOpenID
                        fetch.addAttribute("fullname", "http://schema.openid.net/namePerson", true);
                        fetch.addAttribute("email", "http://schema.openid.net/contact/email", true);
                }

if (verified != null) {
                   AuthSuccess authSuccess = (AuthSuccess) verification.getAuthResponse();
                   if (authSuccess.hasExtension(AxMessage.OPENID_NS_AX)) {
                      FetchResponse fetchResp = (FetchResponse) authSuccess.getExtension(AxMessage.OPENID_NS_AX);
                          List emails = fetchResp.getAttributeValues("email");
                          String email = (String) emails.get(0);

String firstName = fetchResp.getAttributeValue("firstName");
                                String lastName = fetchResp.getAttributeValue("lastName");
                                String fullname=fetchResp.getAttributeValue("fullname");
                                if (fullname==null)  {fullname="";}
                                if (firstName==null) { firstName="";}
                                if (lastName==null) { lastName="";}

--
yahoo authenticates but then returns me to login page and does not seem to 
return email/name

INFO:             cookie=openid_provider=yahoo
INFO:             
header=cookie=JSESSIONID=C8B060982D99A7AFBA9E2BF0B1911BD5.worker1; 
openid_provider=yahoo; has_js=1
INFO:             cookie=openid_provider=yahoo
INFO:             
header=cookie=JSESSIONID=C8B060982D99A7AFBA9E2BF0B1911BD5.worker1; 
openid_provider=yahoo; has_js=1
INFO:          parameter=openid_identifier=http://me.yahoo.com/
INFO:        queryString=openid_identifier=http%3A%2F%2Fme.yahoo.com%2F
INFO:             
header=Location=https://open.login.yahooapis.com/openid/op/auth?openid.ns=http%3
A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.claimed_id=http%3A%2F%2Fspecs.openid
.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F%2Fspecs.openid.
net%2Fauth%2F2.0%2Fidentifier_select&openid.return_to=http%3A%2F%2F127.0.0.1%2Fs
ervlets%2FOpenAuth&openid.realm=http%3A%2F%2F127.0.0.1%2Fservlets%2FOpenAuth&ope
nid.assoc_handle=11Mjmy4sxG1WzmJzLUSRnOSqNPifATq76mNv6SY2gHtRrDvP7RjJN4OBJPYktIT
BrpHqEmibKgjDgqH4NSYhhJ0hQevT5ikqxh7r8zEm1e8oPV6NaIym7GTLu2fRXNKCBmAxoEU-&openid
.mode=checkid_setup&openid.ns.ext1=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0&open
id.ext1.mode=fetch_request&openid.ext1.type.fullname=http%3A%2F%2Fschema.openid.
net%2FnamePerson&openid.ext1.type.email=http%3A%2F%2Fschema.openid.net%2Fcontact
%2Femail&openid.ext1.required=fullname%2Cemail
INFO:             cookie=openid_provider=yahoo
INFO:             
header=cookie=JSESSIONID=C8B060982D99A7AFBA9E2BF0B1911BD5.worker1; 
openid_provider=yahoo; has_js=1
INFO:          parameter=openid.realm=http://127.0.0.1/servlets/OpenAuth
INFO:          parameter=openid.sig=/wliJPYyoCt/Msot1gr8fqmcIPF42TNFY/wWXeZlqc4=
INFO:          
parameter=openid.signed=assoc_handle,claimed_id,identity,mode,ns,op_endpoint,res
ponse_nonce,return_to,signed,pape.auth_level.nist
INFO:          parameter=openid.pape.auth_level.nist=0
INFO:          
parameter=openid.assoc_handle=11Mjmy4sxG1WzmJzLUSRnOSqNPifATq76mNv6SY2gHtRrDvP7R
jJN4OBJPYktITBrpHqEmibKgjDgqH4NSYhhJ0hQevT5ikqxh7r8zEm1e8oPV6NaIym7GTLu2fRXNKCBm
AxoEU-
INFO:          
parameter=openid.op_endpoint=https://open.login.yahooapis.com/openid/op/auth
INFO:          parameter=openid.return_to=http://127.0.0.1/servlets/OpenAuth
INFO:          
parameter=openid.identity=https://me.yahoo.com/a/kJ4VHOB2j5oj_pvaWLwWQLZF7ckLF1I
2FsE-
INFO:          
parameter=openid.claimed_id=https://me.yahoo.com/a/kJ4VHOB2j5oj_pvaWLwWQLZF7ckLF
1I2FsE-#2cf4b
INFO:          parameter=openid.ns=http://specs.openid.net/auth/2.0
INFO:          
parameter=openid.response_nonce=2011-05-07T22:02:24Zj15dzOTUwNHF9DEY_GE8IT1kPr7M
oT8rlA--
INFO:          parameter=openid.mode=id_res
INFO:        
queryString=openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.mode=id_
res&openid.return_to=http%3A%2F%2F127.0.0.1%2Fservlets%2FOpenAuth&openid.claimed
_id=https%3A%2F%2Fme.yahoo.com%2Fa%2FkJ4VHOB2j5oj_pvaWLwWQLZF7ckLF1I2FsE-%232cf4
b&openid.identity=https%3A%2F%2Fme.yahoo.com%2Fa%2FkJ4VHOB2j5oj_pvaWLwWQLZF7ckLF
1I2FsE-&openid.assoc_handle=11Mjmy4sxG1WzmJzLUSRnOSqNPifATq76mNv6SY2gHtRrDvP7RjJ
N4OBJPYktITBrpHqEmibKgjDgqH4NSYhhJ0hQevT5ikqxh7r8zEm1e8oPV6NaIym7GTLu2fRXNKCBmAx
oEU-&openid.realm=http%3A%2F%2F127.0.0.1%2Fservlets%2FOpenAuth&openid.response_n
once=2011-05-07T22%3A02%3A24Zj15dzOTUwNHF9DEY_GE8IT1kPr7MoT8rlA--&openid.signed=
assoc_handle%2Cclaimed_id%2Cidentity%2Cmode%2Cns%2Cop_endpoint%2Cresponse_nonce%
2Creturn_to%2Csigned%2Cpape.auth_level.nist&openid.op_endpoint=https%3A%2F%2Fope
n.login.yahooapis.com%2Fopenid%2Fop%2Fauth&openid.pape.auth_level.nist=0&openid.
sig=%2FwliJPYyoCt%2FMsot1gr8fqmcIPF42TNFY%2FwWXeZlqc4%3D
INFO:             cookie=openid_provider=yahoo
INFO:             
header=cookie=JSESSIONID=C8B060982D99A7AFBA9E2BF0B1911BD5.worker1; 
openid_provider=yahoo; has_js=1
INFO:             cookie=openid_provider=google
INFO:             
header=cookie=JSESSIONID=C8B060982D99A7AFBA9E2BF0B1911BD5.worker1; 
openid_provider=google; has_js=1

-----
Google works and returns my email and name

INFO:          parameter=openid_identifier=https://www.google.com/accounts/o8/id
INFO:        
queryString=openid_identifier=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid
INFO:            
 header=Location=https://www.google.com/accounts/o8/ud?openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.return_to=http%3A%2F%2F127.0.0.1%2Fservlets%2FOpenAuth&openid.realm=http%3A%2F%2F127.0.0.1%2Fservlets%2FOpenAuth&openid.assoc_handle=AOQobUe95JK0a5MVtu4K9fZ_SzblYfXYYrRmcLY2_qQQsE1bGGTnXU1xTqgBjQucPozWheR1&openid.mode=checkid_setup&openid.ns.ext1=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0&openid.ext1.mode=fetch_request&openid.ext1.type.email=http%3A%2F%2Faxschema.org%2Fcontact%2Femail&openid.ext1.type.firstName=http%3A%2F%2Faxschema.org%2FnamePerson%2Ffirst&openid.ext1.type.lastName=http%3A%2F%2Faxschema.org%2FnamePerson%2Flast&openid.ext1.required=email%2CfirstName%2ClastName
INFO:             cookie=openid_provider=google
INFO:             
header=cookie=JSESSIONID=C8B060982D99A7AFBA9E2BF0B1911BD5.worker1; 
openid_provider=google; has_js=1
INFO:          
parameter=openid.response_nonce=2011-05-07T22:05:29Z9WP6tzOsVPh0Kw
INFO:          parameter=openid.ext1.value.firstName=Mr
INFO:          
parameter=openid.signed=op_endpoint,claimed_id,identity,return_to,response_nonce
,assoc_handle,ns.ext1,ext1.mode,ext1.type.firstName,ext1.value.firstName,ext1.ty
pe.email,ext1.value.email,ext1.type.lastName,ext1.value.lastName
INFO:          parameter=openid.sig=XixpVDeVTL46dHV8VEvahLFTWwLY/Qefip6hxWbS5i0=
INFO:          
parameter=openid.ext1.type.firstName=http://axschema.org/namePerson/first
INFO:          
parameter=openid.op_endpoint=https://www.google.com/accounts/o8/ud
INFO:          
parameter=openid.ext1.type.lastName=http://axschema.org/namePerson/last
INFO:          
parameter=openid.ext1.type.email=http://axschema.org/contact/email
INFO:          parameter=openid.ext1.value.lastName=V
INFO:          parameter=openid.ns=http://specs.openid.net/auth/2.0
INFO:          parameter=openid.ext1.mode=fetch_response
INFO:          
parameter=openid.identity=https://www.google.com/accounts/o8/id?id=AItOawnk9WQg4
huzyOG-3WO8ugDfVdPocYy8-iI
INFO:          
parameter=openid.assoc_handle=AOQobUe95JK0a5MVtu4K9fZ_SzblYfXYYrRmcLY2_qQQsE1bGG
TnXU1xTqgBjQucPozWheR1
INFO:          parameter=openid.ext1.value.email=myemail@gmail.com
INFO:          parameter=openid.ns.ext1=http://openid.net/srv/ax/1.0
INFO:          parameter=openid.return_to=http://127.0.0.1/servlets/OpenAuth
INFO:          
parameter=openid.claimed_id=https://www.google.com/accounts/o8/id?id=AItOawnk9WQ
g4huzyOG-3WO8ugDfVdPocYy8-iI
INFO:          parameter=openid.mode=id_res
INFO:        
queryString=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=2011-05-07T22%3A05%3A29Z9WP6tzOsVPh0Kw&openid.return_to=http%3A%2
F%2F127.0.0.1%2Fservlets%2FOpenAuth&openid.assoc_handle=AOQobUe95JK0a5MVtu4K9fZ_
SzblYfXYYrRmcLY2_qQQsE1bGGTnXU1xTqgBjQucPozWheR1&openid.signed=op_endpoint%2Ccla
imed_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=XixpVDeVTL46dHV8VEv
ahLFTWwLY%2FQefip6hxWbS5i0%3D&openid.identity=https%3A%2F%2Fwww.google.com%2Facc
ounts%2Fo8%2Fid%3Fid%3DAItOawnk9WQg4huzyOG-3WO8ugDfVdPocYy8-iI&openid.claimed_id
=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3DAItOawnk9WQg4huzyOG-3W
O8ugDfVdPocYy8-iI&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%2
FnamePerson%2Ffirst&openid.ext1.value.firstName=Mr&openid.ext1.type.email=http%3
A%2F%2Faxschema.org%2Fcontact%2Femail&openid.ext1.value.email=myemail%40gmail.co
m&openid.ext1.type.lastName=http%3A%2F%2Faxschema.org%2FnamePerson%2Flast&openid
.ext1.value.lastName=MYLASTNAME
INFO:             cookie=openid_provider=google
INFO:             
header=cookie=JSESSIONID=C8B060982D99A7AFBA9E2BF0B1911BD5.worker1; 
openid_provider=google; has_js=1

Has anyone seen this before?

I have tried to add an xrds.xml file to the html page of the site too but it 
has made no difference

Original issue reported on code.google.com by bad...@gmail.com on 7 May 2011 at 10:32

GoogleCodeExporter commented 8 years ago
sorry not a defect oops it was a question.

Original comment by bad...@gmail.com on 7 May 2011 at 10:32

GoogleCodeExporter commented 8 years ago
I'm seeing this behaviour too... Did you find already a solution for this?

Original comment by pieter.d...@systemworks.be on 20 Jun 2011 at 12:23

GoogleCodeExporter commented 8 years ago
Double-check the extension (SREG/AX) and/or attribute types supported by Yahoo.

Original comment by Johnny.B...@gmail.com on 31 Oct 2012 at 9:31

GoogleCodeExporter commented 8 years ago

Original comment by Johnny.B...@gmail.com on 1 Nov 2012 at 12:45