ClaimsAuthenticationManager conversion claim with Windows authentication

I want to write an MVC5 application that uses Windows Authentication.

In accordance with the code template, applications @User.Identity.Name

are filled in automatically.

I would like to transform the incoming claims with my own logic and enrich them so that roles are assigned to users:

class SimpleClaimsAuthenticatonManager : ClaimsAuthenticationManager
{
    public override ClaimsPrincipal Authenticate(string resourceName, ClaimsPrincipal incomingPrincipal)
    {
        if (incomingPrincipal != null && incomingPrincipal.Identity.IsAuthenticated == true)
        {
            ((ClaimsIdentity)incomingPrincipal.Identity).AddClaim(new Claim(ClaimTypes.Role, "User"));
        }
        return incomingPrincipal; 
    }
}

      

Does the Thinktecture Identity Model Library support a way to connect the aforementioned custom AuthenticationManager to the MVC5 pipeline?

+3
asp.net-mvc wif claims-based-identity thinktecture-ident-model


source to share


No one has answered this question yet

Check out similar questions:

175
Explain "claims based authentication" for 5 year old
20
Simple claims conversion and caching w / windows authentication
3
Using a Custom RoleProvider with Windows Identity Foundation - STS
3
Client certificates and claims-based identity based on web API
1
No claims are guaranteed.
1
How to avoid converting claims for specific requests in Core Asp.NET
1
Thinktecture Identity Server Requirements
0
SessionAuthenticationModule does not deserialize all claims from cookie, sometimes
0
Authentication - Provide your login email to look up your user ID
0
Redirect MVC to user with specific claim



All Articles
Loading...
X
Show
Funny
Dev
Pics