using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Tiobon.Core.HttpContextUser; using Tiobon.Core.Model.Entity; namespace Tiobon.Core.Gateway.Controllers { [Authorize(AuthenticationSchemes = Permissions.GWName)] [Route("/gateway/[controller]/[action]")] public class UserController : ControllerBase { private readonly IUser _user; public UserController(IUser user) { _user = user; } [HttpGet] public ServiceResult> MyClaims() { return new ServiceResult>() { Success = true, Data = (_user.GetClaimsIdentity().ToList()).Select(d => new ClaimDto { Type = d.Type, Value = d.Value } ).ToList() }; } } public class ClaimDto { public string Type { get; set; } public string Value { get; set; } } }