Open Source Web Application Framework for ASP.NET Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

16 lines
353 B

using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace OpenIddict.Demo.API.Controllers;
[ApiController]
[Authorize]
[Route("api/claims")]
public class ClaimsController : Controller
{
[HttpGet]
public JsonResult Get()
{
return Json(User.Claims.Select(x => new {Type = x.Type, Value = x.Value}));
}
}