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
source to share
No one has answered this question yet
Check out similar questions: