I'm trying to get DotNetOpenAuth (latest version) to work with ASP.NET MVC 2 website. I get the first part working, the action is invoked when user selects OpenID provider, I get correct identifier passed in, I then get correctly redirected to the provider website, I get redirected back to my website but here's the problem.
The claims I requested are null (see the 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;
// data is null <-----------------------------------------
return View("Index");
}
}
return View("Index");
}
I would greatly appreciate if anyone can point out the (not so) obvious mistake I'm making.