Skip to content

Commit

Permalink
Fix claim header name
Browse files Browse the repository at this point in the history
  • Loading branch information
ParadoxZero committed Jul 24, 2024
1 parent 71140c8 commit 7d1f3b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/services/azure_identity_service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public AzureIdentityService(IHttpContextAccessor httpContextAccessor)

public string GetUserIdentity()
{
if (_httpContextAccessor.HttpContext != null && _httpContextAccessor.HttpContext!.Request.Headers.TryGetValue("X-MS-CLIENT-PRINCIPAL-ID", out var userId))
if (_httpContextAccessor.HttpContext != null && _httpContextAccessor.HttpContext!.Request.Headers.TryGetValue("X-MS-CLIENT-PRINCIPAL", out var userId))
{
string decoded_userId = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(userId!));
dynamic claims = JsonSerializer.Deserialize<dynamic>(decoded_userId) ?? throw new Exception("Claims not valid JSON");
Expand All @@ -25,7 +25,7 @@ public string GetUserIdentity()
case "github":
return ProcessGithub(claims);
default:
throw new Exception("Provider not supported");
throw new Exception("Provider not supported" + provider.ToString());
}
}

Expand Down

0 comments on commit 7d1f3b8

Please sign in to comment.