Claims

Configuration

// Add RCommon services
builder.Services.AddRCommon()
    .WithClaimsAndPrincipalAccessor();

Usage

public class MyService
{
    private readonly ICurrentUser _currentUser;

    public MyService(ICurrentUser currentUser)
    {
        _currentUser = currentUser;
    }
    
    public Claim[] GetClaims()
    {
        return _currentUser.GetAllClaims();
    }
}

Last updated