Null ClaimsResponse with DotNetOpenAuth in ASP.NET MVC 2 Application

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;
                // data is null <-----------------------------------------
                return View("Index");
            }
    }
    return View("Index");
}

I would really appreciate if anyone could point out the obvious error (not so) that I am making.

+1
source share
2 answers

, .

. , AXFetchAsSregTransform web.config, , - . , - . , Yahoo, , RP RP Discovery, RP, DotNetOpenAuth.

, RP Discovery . , . , RP Providers , RP Discovery , .

+3

, , Google DomainLevel.Require DomainLevel.Request()

fields.Email = DemandLevel.Require;
+5

Source: https://habr.com/ru/post/1752005/


All Articles