Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Produces("application/json")]
public class IdentityController : Controller
{
[HttpGet]
[Authorize("Founder")]
[Route("api/resource-with-policy")]
public IActionResult ResourceWithPolicy()
{
return new JsonResult(new { ApiName = "Api1", AuthorizationType = "With Policy" });
}
[HttpGet]
[Authorize]
[Route("api/resource-without-policy")]
public IActionResult ResourceWithoutPolicy()
{
return new JsonResult(new { ApiName = "Api1", AuthorizationType = "Without Policy" });
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment