GetUserId_reads_NameIdentifier_when_sub_was_mapped
Some checks failed
Dotnet build and test / log-the-inputs (push) Has been cancelled
Dotnet build and test / build (push) Has been cancelled

This commit is contained in:
Paul Schneider 2026-08-10 18:34:01 +01:00
commit 0d3fbf22c3
No known key found for this signature in database
GPG key ID: 1E66C65EE2B46F1B
5 changed files with 290 additions and 1 deletions

View file

@ -32,7 +32,9 @@ namespace Yavsc.Server.Helpers
public static string GetUserId(this ClaimsPrincipal user)
{
return user.FindFirstValue("sub");
return user.FindFirstValue("sub")
?? user.FindFirstValue(ClaimTypes.NameIdentifier)
?? user.FindFirstValue("nameid");
}
public static string GetUserName(this ClaimsPrincipal user)