Skip to content

Instantly share code, notes, and snippets.

@artisticcheese
Last active April 15, 2018 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artisticcheese/52f9cf12e8d31aade2aab9cd7345bfea to your computer and use it in GitHub Desktop.
Save artisticcheese/52f9cf12e8d31aade2aab9cd7345bfea to your computer and use it in GitHub Desktop.
[Authorize(Roles = "Domain Admins")]
public IActionResult Windows()
{
return Content ("You are " + User.Identity.Name + "; Authentication Type:" + User.Identity.AuthenticationType );
}
[Authorize(Roles = "Domain Users")]
public IActionResult Users()
{
return Content("You are " + User.Identity.Name + "; Authentication Type:" + User.Identity.AuthenticationType);
}
public IActionResult LocalUsers()
{
return Content("You are " + User.Identity.Name + "; Authentication Type:" + User.Identity.AuthenticationType);
}
[AllowAnonymous]
public IActionResult Anonymous()
{
return Content ("You are " + User.Identity.Name + "; Authentication Type:" + User.Identity.AuthenticationType );;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment