I use the DoNetOpenAuth library and follow the example here
Authentication works, but even though I need an email, the request will be zero. In fact, it does not matter what I demand, states that the answer is always zero. Not sure what I am doing wrong, and I would appreciate your help.
Thanks in advance.
Here is my login button code
protected void btnSubmit_Click( object sender, EventArgs e )
{
using (OpenIdRelyingParty openId = new OpenIdRelyingParty())
{
IAuthenticationRequest request = openId.CreateRequest( txtOpenID.Text );
request.AddExtension( new ClaimsRequest
{
Email = DemandLevel.Require,
Country = DemandLevel.Request,
TimeZone = DemandLevel.Request
} );
request.RedirectToProvider();
}
}
Here is the page load code. The ClaimsResponse variable is always null.
protected void Page_Load( object sender, EventArgs e )
{
OpenIdRelyingParty openId = new OpenIdRelyingParty();
var response = openId.GetResponse();
if(response != null)
{
switch ( response.Status )
{
case AuthenticationStatus.Authenticated:
var claimsResponse = response.GetExtension<ClaimsResponse>();
break;
case AuthenticationStatus.Canceled:
break;
case AuthenticationStatus.Failed:
break;
}
}
}
source
share