1

Get/Fetch email and other profile info using OpenId

Hi,

If you want to extract Yahoo! User profile info like email,name,etc using Yahoo! OpenID AX Implementation this is the way:
This is the URL with the parameters:

https://open.login.yahooapis.com/openid/op/auth?
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.mode=checkid_setup
&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0
&openid.realm=##Your Domain name##
&openid.return_to=##Your Return URL##
&openid.ns.oauth=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Foauth%2F1.0
&openid.oauth.consumer=##Consumer Key##
&openid.ns.ax=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0
&openid.ax.mode=fetch_request
&openid.ax.required=email,fullname,nickname
&openid.ax.type.email=http%3A%2F%2Faxschema.org%2Fcontact%2Femail
&openid.ax.type.fullname=http%3A%2F%2Faxschema.org%2FnamePerson
&openid.ax.type.nickname=http%3A%2F%2Faxschema.org%2FnamePerson%2Ffriendly


You can only get specific fields from a persons profile as given here.

Property name => schema address
"nickname" => "http://axschema.org/namePerson/friendly",
"fullname" => "http://axschema.org/namePerson",
"email" => "http://axschema.org/contact/email",
"gender" => "http://axschema.org/person/gender",
"language" => "http://axschema.org/pref/language",
"timezone" => "http://axschema.org/pref/timezone",
"image" => "http://axschema.org/media/image/default"

In the Required field write the property name (comma seperated) (like openid.ax.required=email,fullname,nickname)
and then give the schema also (like openid.ax.type.email=http%3A%2F%2Faxschema.org%2Fcontact%2Femail)

Rest parameters need not be changed except for giving your realm,Return Url and Consumer Key

You will get the desired info in the QueryString of your Response

For any help, feel free to contact me.

Regards,
Varun

by
1 Reply
  • I am not getting the desired info (email, gender) in the QueryString response. Is it because I am using OAuth with my request?

    REQUEST:
    <https://open.login.yahooapis.com/openid/op/auth?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%example.com%3A9998%2Foauth%2Fyahoo%2Faccess
    &openid.realm=http%3A%2F%2Fexample.com%3A9998%2Foauth%2Fyahoo%2Faccess
    &openid.assoc_handle=xxxxxxxxxxxxxx
    &openid.mode=checkid_setup
    &openid.ns.ext1=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Foauth%2F1.0
    &openid.ext1.mode=fetch_request
    &openid.ext1.type.email=http%3A%2F%2Faxschema.org%2Fcontact%2Femail
    &openid.ext1.type.gender=http%3A%2F%2Faxschema.org%2Fperson%2Fgender
    &openid.ext1.required=email,gender
    &openid.ext1.consumer=xxxxxxxxxxxxx
    
    RESPONSE:
    <http://example.com>:9998/oauth/yahoo/access?openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0
    &openid.mode=id_res
    &openid.return_to=http%3A%2F%2Fexample.com%3A9998%2Foauth%2Fyahoo%2Faccess
    &openid.claimed_id=https%3A%2F%2Fme.yahoo.com%2Fa%2FzeYWuYQai4D3jZSOTh520wmJidpOqUc-%23f88cd
    &openid.identity=https%3A%2F%2Fme.yahoo.com%2Fa%2Fxxxxxxxxxxxxxxx
    &openid.assoc_handle=xxxxxxxxxxxxx
    &openid.realm=http%3A%2F%example.com%3A9998%2Foauth%2Fyahoo%2Faccess
    &openid.ns.oauth=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Foauth%2F1.0
    &openid.oauth.mode=fetch_request
    &openid.oauth.type.email=http%3A%2F%2Faxschema.org%2Fcontact%2Femail
    &openid.oauth.type.gender=http%3A%2F%2Faxschema.org%2Fperson%2Fgender
    &openid.oauth.required=email%2Cgender
    &domain_unverified=1
    &openid.response_nonce=2013-12-11T22%3A37%3A42ZOOzN6lvjSTpRZKqvry40udTutas0ok8Kfw--
    &openid.signed=assoc_handle%2Cclaimed_id%2Cidentity%2Cmode%2Cns%2Cop_endpoint%2Cresponse_nonce%2Creturn_to%2Csigned%2Cpape.auth_level.nist%2Cns.oauth%2Coauth.request_token
    &openid.op_endpoint=https%3A%2F%2Fopen.login.yahooapis.com%2Fopenid%2Fop%2Fauth
    &openid.pape.auth_level.nist=0
    &openid.oauth.request_token=xxxxxxxx
    

    Perhaps it's not documented that if your domain is not verified, you won't get that info ??

    0

Recent Posts

in OpenID General Discussion