Skip to content

Commit fa29e11

Browse files
chore: should not lowercase org_name claim (#185)
1 parent 6f8262d commit fa29e11

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/omniauth/auth0/jwt_validator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def verify_org(id_token, organization)
283283
if !org_name || !org_name.is_a?(String)
284284
raise OmniAuth::Auth0::TokenValidationError,
285285
'Organization Name (org_name) claim must be a string present in the ID token'
286-
elsif org_name.downcase != organization.downcase
286+
elsif org_name != organization.downcase
287287
raise OmniAuth::Auth0::TokenValidationError,
288288
"Organization Name (org_name) claim value mismatch in the ID token; expected '#{organization}', found '#{org_name}'"
289289
end

spec/omniauth/auth0/jwt_validator_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,11 +582,11 @@
582582
aud: client_id,
583583
exp: future_timecode,
584584
iat: past_timecode,
585-
org_name: 'MY-ORGANIZATION'
585+
org_name: 'my-organization'
586586
}
587587

588588
token = make_hs256_token(payload)
589-
jwt_validator.verify(token, { organization: 'my-organization' })
589+
jwt_validator.verify(token, { organization: 'MY-ORGANIZATION' })
590590
end
591591
end
592592
it 'should fail for RS256 token when kid is incorrect' do

0 commit comments

Comments
 (0)