using System.Security.Claims;
using OpenIddict.Abstractions;
using static OpenIddict.Abstractions.OpenIddictConstants;

namespace Ablera.Serdica.Authentication.Extensions;

public static class PrincipalBuilder
{
    public static ClaimsPrincipal Build(string clientId, string authenticationSchema)
    {
        var claimsIdentity = new ClaimsIdentity(authenticationSchema);
        claimsIdentity.AddClaim(Claims.Subject, clientId, Destinations.AccessToken);
        var claimsPrincipal = new ClaimsPrincipal(claimsIdentity);
        return claimsPrincipal;
    }
}
