Added custom scheme

This commit is contained in:
Max
2024-07-13 16:27:45 +02:00
parent de656cc2e8
commit 5341179e94
5 changed files with 74 additions and 16 deletions

View File

@@ -1,20 +1,24 @@
using System.Security.Claims;
using DotBased.Logging;
using Microsoft.AspNetCore.Components.Authorization;
namespace DotBased.ASP.Auth;
// RevalidatingServerAuthenticationStateProvider
public class BasedAuthenticationStateProvider : AuthenticationStateProvider
{
public BasedAuthenticationStateProvider()
public BasedAuthenticationStateProvider(BasedAuthConfiguration configuration)
{
_config = configuration;
_logger = LogService.RegisterLogger(typeof(BasedAuthenticationStateProvider));
}
private BasedAuthConfiguration _config;
private ILogger _logger;
private AuthenticationState _anonState = new AuthenticationState(new ClaimsPrincipal(new ClaimsIdentity(new List<Claim>() {new Claim(ClaimTypes.Role, "test")})));
public override Task<AuthenticationState> GetAuthenticationStateAsync()
{
throw new NotImplementedException();
return Task.FromResult(_anonState);
}
}