Skip to content

Commit

Permalink
fix(auth): set API key PrincipalName as sub claim (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fenrikur authored Sep 14, 2024
1 parent a1581f8 commit 29e46e9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ protected override Task<AuthenticateResult> HandleAuthenticateAsync()

var claims = new List<Claim>
{
new Claim(ClaimTypes.Name, apiKeyOptions.PrincipalName)
new Claim(ClaimTypes.Name, apiKeyOptions.PrincipalName),
new Claim("sub", apiKeyOptions.PrincipalName)
};

foreach (var role in apiKeyOptions.Roles)
Expand Down

0 comments on commit 29e46e9

Please sign in to comment.