How do I retrieve google profile with DotNetOpenAuth?

限于喜欢 提交于 2019-12-01 01:09:08

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!