Refinement and cleanup

This commit is contained in:
Karolis Kundrotas
2021-09-10 01:54:05 +03:00
parent 99a978dede
commit fc699ca874
18 changed files with 301 additions and 375 deletions

View File

@@ -0,0 +1,24 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace KTUSA_PS.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class AuthMetadataController : ControllerBase
{
private readonly IConfiguration _configuration;
public AuthMetadataController(IConfiguration configuration)
{
_configuration = configuration;
}
[HttpGet]
public object Index() => new { ClientId = _configuration["ClientId"], Authority = _configuration["Authority"], Tenant = _configuration["Tenant"] };
}
}

View File

@@ -15,9 +15,9 @@ namespace KTUSA_PS.Controllers
public class TestController : ControllerBase
{
[HttpGet]
public Object[] Index()
public object[] Index()
{
return this.HttpContext.User.Claims.Select(x => new { Name = x.Type, Value= x.Value }).ToArray();
return HttpContext.User.Claims.Select(x => new { Name = x.Type, Value= x.Value }).ToArray();
}
[HttpGet("authed")]