How to include AX extension in OpenID auth request using DotNetOpenAuth

天涯浪子 提交于 2019-12-11 06:22:45

问题


How to make attribute exchange request in dotnetopenauth.


回答1:


If you are just trying to get standard attributes, I recommend you read about the AXFetchAsSregTransform which hides the complexity of AX and SREG attribute gathering from your site.

If you are doing something custom and know what AX attributes you need to request, here is sample code:

var rp = new OpenIdRelyingParty();
var request = rp.CreateRequest("=some*identifier");
var ax = new FetchRequest();
ax.Attributes.AddRequired(WellKnownAttributes.Contact.Email);
request.AddExtension(ax);
request.RedirectToProvider();


来源:https://stackoverflow.com/questions/3317658/how-to-include-ax-extension-in-openid-auth-request-using-dotnetopenauth

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