I am trying to use DNOA for OpenId support to my app, in order to leave the Janrain solution I have been using so far. The problem is that the users I have so far have profile based identifiers (https://www.google.com/profiles/11223344556677... ), while the identifier retrieved by DNOA is in the form https://www.google.com/accounts/o8/id?id=xxxxxyyyyyafgsdgfsdhg.
How do I retrieve the profile information? Through Attribute Exchange? and which attribute? Or is there some other API? I saw that the login page has a provider for google and a different one for google profile, so someone around here has an answer... :)
Update: the endpoint for google profiles is (https://www.google.com/profiles/)
So... the question now is rather how to get the google profile id number
the google profile id number is retrieved through the "http://schemas.openid.net/ax/api/user_id" attribute. Set this to required
In DNOA,
var fetch = new FetchRequest();
fetch.Attributes.AddRequired("http://axschema.org/contact/country/home");
fetch.Attributes.AddRequired("http://axschema.org/contact/email");
fetch.Attributes.AddRequired("http://axschema.org/namePerson/first");
fetch.Attributes.AddRequired("http://axschema.org/namePerson/last");
fetch.Attributes.AddRequired("http://axschema.org/pref/language");
fetch.Attributes.AddRequired("http://schemas.openid.net/ax/api/user_id");
funny thing is that, if I omit some of these attributes, I don't get the api/user_id back. Can't figure that part out, but I don't really care at this point.
Google actually has 2 (maybe more) openid providers - accounts and profiles. I don't really know why there are 2 but all Google Account owners do not have a Google Profile.
There is also a big difference between the two. Google Profiles openid identifier is the same anywhere you use it. Google Accounts id is not! When logging-in with Google Accounts as an OpenID provider you'll get different ID for every domain. It's a new (optional, I think) feature of OpenID, but I can't remember it's name at this moment.
With all that said I don't think Google will give you any data which Google Account identifier correlates to which Google Profiles identifier.
Hope this helps in any way.
来源:https://stackoverflow.com/questions/4365572/how-do-i-retrieve-google-profile-with-dotnetopenauth