Last active
April 24, 2018 11:21
-
-
Save arnabdas/ee66d59e3a6c7f0603b31816a9a21d55 to your computer and use it in GitHub Desktop.
Print claims
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomAuthorizeAttribute : AuthorizeAttribute | |
{ | |
protected override bool IsAuthorized(HttpActionContext actionContext) | |
{ | |
var principal = actionContext.RequestContext.Principal as ClaimsPrincipal; | |
System.Text.StringBuilder s = new System.Text.StringBuilder(); | |
s.AppendLine("Type,Value,ValueType"); | |
principal.Claims.ToList().ForEach(c => s.AppendLine($"{c.Type},{c.Value},{c.ValueType}")); | |
System.Diagnostics.Debug.WriteLine(s.ToString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment