fails to receive email attribute

7 views
Skip to first unread message

newbie@openID

unread,
Feb 3, 2008, 3:28:34 AM2/3/08
to OpenID4Java
I am trying out simple-openid jsp samples with additional code for
fetching email attribute.
Not sure what i am doing wrong. Please help!!!

I have modified my consumer_redirect.jsp to fetch email. The redirect
page seems to have generated following hidden values.


<input type="hidden" name="openid.ns.ext1" value="http://
openid.net/srv/ax/1.0-draft4"/>

<input type="hidden" name="openid.ext1.mode"
value="fetch_request"/>

<input type="hidden" name="openid.ext1.type.email"
value="http://schema.openid.net/contact/email"/>

<input type="hidden" name="openid.ext1.required" value="email"/
>

<button type="submit">Continue...</button>
</form>

I modified my consumer_returnurl.jsp to

// extract the parameters from the authentication response
// (which comes in as a HTTP request from the OpenID
provider)
ParameterList responselist =
new ParameterList(request.getParameterMap());

// retrieve the previously stored discovery information
DiscoveryInformation discovered =
(DiscoveryInformation)
session.getAttribute("openid-disco");

// extract the receiving URL from the HTTP request
StringBuffer receivingURL = request.getRequestURL();
String queryString = request.getQueryString();
if (queryString != null && queryString.length() > 0)

receivingURL.append("?").append(request.getQueryString());

// verify the response; ConsumerManager needs to be the
same
// (static) instance used to place the authentication
request
VerificationResult verification = manager.verify(
receivingURL.toString(),
responselist, discovered);

// examine the verification result and extract the
verified identifier
Identifier verified = verification.getVerifiedId();
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 aliases = fetchResp.getAttributeAliases();
for (Iterator iter = aliases.iterator(); iter.hasNext();) {
String alias = (String) iter.next();
List values = fetchResp.getAttributeValues(alias);
if (values.size() > 0) {
request.setAttribute(alias, values.get(0));
if (alias.equals("Email")) {
String email = (String) values.get(0);
session.setAttribute("openid-email",
email);
}
}
}// iterator


What am i doing wrong?
- very desperate.
thanks

newbie@openID

unread,
Feb 3, 2008, 4:37:16 AM2/3/08
to OpenID4Java
It does not seem to go past the following check. I am using
myopenid.com provider. any clues?

if (authSuccess.hasExtension(AxMessage.OPENID_NS_AX))

zhous...@gmail.com

unread,
Feb 3, 2008, 8:11:40 AM2/3/08
to openi...@googlegroups.com
Try this: http://openid.net.cn/consumer-servlet
This is the demo of openid4java/samples/consumer-servlet


--
Sutra Zhou

newbie@openID

unread,
Feb 3, 2008, 2:30:32 PM2/3/08
to OpenID4Java
thanks. i tried both the examples from this site. I still do not get
the extended attributes. Here is the output. Is myopenid provider has
an issue? should i try different providers?

Login Success!
queryString: is_return=true&openid.assoc_handle=%7BHMAC-SHA256%7D
%7B47a5bc87%7D%7BunNOHA%3D%3D%7D&openid.claimed_id=http%3A%2F
%2Ftest02appmail.myopenid.com%2F&openid.identity=http%3A%2F
%2Ftest02appmail.myopenid.com%2F&openid.mode=id_res&openid.ns=http%3A
%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.op_endpoint=http%3A%2F
%2Fwww.myopenid.com
%2Fserver&openid.response_nonce=2008-02-03T19%3A27%3A35Z9gEzk3&openid.return_to=http
%3A%2F%2Fopenid.net.cn%2Fconsumer-servlet%2Fconsumer%3Fis_return
%3Dtrue&openid.sig=DQbElCpWnHFnvNs5Mk9XzAROW3TnMUR1UTNL6TTzIuw
%3D&openid.signed=assoc_handle%2Cclaimed_id%2Cidentity%2Cmode%2Cns
%2Cop_endpoint%2Cresponse_nonce%2Creturn_to%2Csigned

Your OpenID: http://test02appmail.myopenid.com/
Nickname:
Email:
Fullname:
Date of birth:
Gender:
Postcode:
Country:
Language:
Timezone:
Logout
> Sutra Zhou- Hide quoted text -
>
> - Show quoted text -

newbie@openID

unread,
Feb 3, 2008, 4:43:13 PM2/3/08
to OpenID4Java
i tried verisign PIP as well. Still no luck with the extended
attributes. I am quite desperate to get this working. Someone please
help??


On Feb 3, 11:30 am, "newbie@openID" <leenadaptar...@gmail.com> wrote:
> thanks. i tried both the examples from this site. I still do not get
> the extended attributes. Here is the output. Is myopenid provider has
> an issue? should i try different providers?
>
> Login Success!
> queryString: is_return=true&openid.assoc_handle=%7BHMAC-SHA256%7D
> %7B47a5bc87%7D%7BunNOHA%3D%3D%7D&openid.claimed_id=http%3A%2F
> %2Ftest02appmail.myopenid.com%2F&openid.identity=http%3A%2F
> %2Ftest02appmail.myopenid.com%2F&openid.mode=id_res&openid.ns=http%3A
> %2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.op_endpoint=http%3A%2F
> %2Fwww.myopenid.com
> %2Fserver&openid.response_nonce=2008-02-03T19%3A27%3A35Z9gEzk3&openid.retur­n_to=http
> > - Show quoted text -- Hide quoted text -

Sutra Zhou

unread,
Feb 3, 2008, 8:46:35 PM2/3/08
to openi...@googlegroups.com
Haven't you fill this page:  https://www.myopenid.com/persona_chooser ?

2008/2/4, newbie@openID <leenada...@gmail.com>:

newbie@openID

unread,
Feb 4, 2008, 4:38:57 AM2/4/08
to OpenID4Java
aha. That was it. It worked with sreg. thank you. ax did not work.
thanks a lot.

On Feb 3, 5:46 pm, "Sutra Zhou" <zhoushu...@gmail.com> wrote:
> Haven't you fill this page:  https://www.myopenid.com/persona_chooser?
>
> 2008/2/4, newbie@openID <leenadaptar...@gmail.com>:
>
>
>
>
>
> > thanks. i tried both the examples from this site. I still do not get
> > the extended attributes. Here is the output. Is myopenid provider has
> > an issue? should i try different providers?
>
> > Login Success!
> > queryString: is_return=true&openid.assoc_handle=%7BHMAC-SHA256%7D
> > %7B47a5bc87%7D%7BunNOHA%3D%3D%7D&openid.claimed_id=http%3A%2F
> > %2Ftest02appmail.myopenid.com%2F&openid.identity=http%3A%2F
> > %2Ftest02appmail.myopenid.com%2F&openid.mode=id_res&openid.ns=http%3A
> > %2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.op_endpoint=http%3A%2F
> > %2Fwww.myopenid.com
>
> > %2Fserver&openid.response_nonce=2008-02-03T19%3A27%3A35Z9gEzk3&openid.retur­n_to=http
> > > - Show quoted text -- Hide quoted text -

Johnny Bufu

unread,
Feb 5, 2008, 12:44:35 AM2/5/08
to openi...@googlegroups.com

> On 3-Feb-08, at 12:28 AM, newbie@openID wrote:
>> I have modified my consumer_redirect.jsp to fetch email. The redirect
>> page seems to have generated following hidden values.
>>
>> <input type="hidden" name="openid.ns.ext1" value="http://
>> openid.net/srv/ax/1.0-draft4"/>

On 3-Feb-08, at 1:37 AM, newbie@openID wrote:
> It does not seem to go past the following check. I am using
> myopenid.com provider. any clues?
>
> if (authSuccess.hasExtension(AxMessage.OPENID_NS_AX))

Myopenid.com advertises the http://openid.net/srv/ax/1.0 extension
(v1.0 final), while your request contains a -draft4 AX fetch.


Try running the simple-openid from the latest SVN trunk (though I
believed simple-openid used maven to pull down the latest published
dependencies).


Johnny

Reply all
Reply to author
Forward
0 new messages