[WIP] Working schemes

This commit is contained in:
max 2025-05-02 23:50:09 +02:00
parent edf8891ddc
commit 05b95c6050

View File

@ -1,16 +1,24 @@
using System.Text.Json; using System.Text.Json;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace DotBased.AspNet.Authority.Controllers; namespace DotBased.AspNet.Authority.Controllers;
[ApiController] [ApiController]
[Route("[controller]")] [Microsoft.AspNetCore.Mvc.Route("[controller]")]
public class AuthorityController : ControllerBase public class AuthorityController : ControllerBase
{ {
[Inject]
public IAuthenticationService AuthenticationService { get; set; }
[HttpGet("auth/login")] [HttpGet("auth/login")]
public async Task<ActionResult> LoginFromSchemeAsync([FromQuery(Name = "s")] string scheme) [AllowAnonymous]
public async Task<ActionResult> LoginFromSchemeAsync([FromQuery(Name = "s")] string? scheme)
{ {
return BadRequest(); var authResult = await HttpContext.AuthenticateAsync();
return Ok();
} }
[HttpGet("auth/logout")] [HttpGet("auth/logout")]