Niraj Choubey
Niraj Choubey

Reputation: 4040

How to include AX extension in OpenID auth request using DotNetOpenAuth

How to make attribute exchange request in dotnetopenauth.

Upvotes: 1

Views: 586

Answers (1)

Andrew Arnott
Andrew Arnott

Reputation: 81801

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();

Upvotes: 2

Related Questions