Skip to content

Commit

Permalink
Do not lowercase org_name claim (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikprijck authored Jul 18, 2023
1 parent 5143230 commit 88e8335
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Auth0.OidcClient.Core/Tokens/IdTokenValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ private static void AssertTokenClaimsMeetRequirements(IdTokenRequirements requir
if (!string.IsNullOrWhiteSpace(required.Organization))
{
var organizationClaim = required.Organization.StartsWith("org_") ? Auth0ClaimNames.OrganizationId : Auth0ClaimNames.OrganizationName;
var rawOrganizationClaimValue = GetClaimValue(token.Claims, organizationClaim);
var organizationClaimValue = organizationClaim == Auth0ClaimNames.OrganizationName ? rawOrganizationClaimValue?.ToLower() : rawOrganizationClaimValue;
var organizationClaimValue = GetClaimValue(token.Claims, organizationClaim);
var expectedOrganization = organizationClaim == Auth0ClaimNames.OrganizationName ? required.Organization.ToLower() : required.Organization;

if (string.IsNullOrWhiteSpace(organizationClaimValue))
Expand Down

0 comments on commit 88e8335

Please sign in to comment.