24 lines
601 B
C#
24 lines
601 B
C#
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace KTUSA_PS.Controllers
|
|
{
|
|
[Route("[controller]")]
|
|
[Authorize]
|
|
[ApiController]
|
|
public class TestController : ControllerBase
|
|
{
|
|
[HttpGet]
|
|
public Object[] Index()
|
|
{
|
|
return this.HttpContext.User.Claims.Select(x => new { Name = x.Type, Value= x.Value }).ToArray();
|
|
}
|
|
}
|
|
}
|