mirror of
https://github.com/hmaxnl/SharpRSS.git
synced 2024-11-10 16:04:19 +01:00
19 lines
618 B
C#
19 lines
618 B
C#
using System.Security.Claims;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Components.Authorization;
|
|
|
|
namespace SharpRSS.Blazor.Data
|
|
{
|
|
public class SrssAuthenticationStateProvider : AuthenticationStateProvider
|
|
{
|
|
public override Task<AuthenticationState> GetAuthenticationStateAsync()
|
|
{
|
|
var identity = new ClaimsIdentity(new[]
|
|
{
|
|
new Claim(ClaimTypes.Name, "srss")
|
|
}, "Custom Authentication");
|
|
var user = new ClaimsPrincipal(identity);
|
|
return Task.FromResult(new AuthenticationState(user));
|
|
}
|
|
}
|
|
} |