Skip to content
Permalink
master
Switch branches/tags
Go to file
Latest commit 56d4277 Apr 5, 2019 History
1 contributor

Users who have contributed to this file

using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Resource.Api.Controllers
{
[Authorize(Policy = "ApiReader")]
[Route("api/[controller]")]
[ApiController]
public class ValuesController : ControllerBase
{
// GET api/values
[Authorize(Policy = "Consumer")]
[HttpGet]
public ActionResult<IEnumerable<string>> Get()
{
return new JsonResult(User.Claims.Select(c => new { c.Type, c.Value }));
}
}
}