I am trying to get DotNetOpenAuth (latest version) to work with the ASP.NET MVC 2 website. I get the first part of the action, the action is called when the user selects the OpenID provider, I get the correct identifier that is passed, then I get redirected to the provider website correctly , they redirect me back to my site, but here is the problem.
Claims made by me are null (see code below).
public ActionResult TryAuth(string openid_identifier)
{
var openid = new OpenIdRelyingParty();
var response = openid.GetResponse();
if(response== null)
{
var req = openid.CreateRequest(openid_identifier);
req.AddExtension(new ClaimsRequest
{
Email = DemandLevel.Require,
Nickname = DemandLevel.Require
});
return req.RedirectingResponse.AsActionResult();
}
switch(response.Status)
{
case AuthenticationStatus.Authenticated:
{
var data = response.GetExtension(typeof(ClaimsResponse)) as ClaimsResponse;
return View("Index");
}
}
return View("Index");
}
I would really appreciate if anyone could point out the obvious error (not so) that I am making.
source
share