File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
main/java/com/auth0/android/provider
test/java/com/auth0/android/provider Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ internal class IdTokenVerifier {
73
73
if (TextUtils .isEmpty(orgNameClaim)) {
74
74
throw OrgNameClaimMissingException ()
75
75
}
76
- if (organizationInput != orgNameClaim) {
76
+ if (! organizationInput.equals( orgNameClaim, true ) ) {
77
77
throw OrgNameClaimMismatchException (organizationInput, orgNameClaim)
78
78
}
79
79
}
Original file line number Diff line number Diff line change @@ -294,6 +294,25 @@ public void shouldFailWhenOrganizationNameClaimIsRequiredAndHasUnexpectedValue()
294
294
assertEquals ("com.auth0.android.provider.TokenValidationException: " + message , e .toString ());
295
295
assertEquals (message , e .getMessage ());
296
296
}
297
+ @ Test
298
+ public void shouldNotFailWhenOrganizationNameClaimIsRequiredAndHasSameValue () throws Exception {
299
+ Map <String , Object > jwtBody = createJWTBody ();
300
+ jwtBody .put ("org_name" , EXPECTED_ORGANIZATION_NAME );
301
+ String token = createTestJWT ("none" , jwtBody );
302
+ Jwt jwt = new Jwt (token );
303
+ options .setOrganization (EXPECTED_ORGANIZATION_NAME );
304
+ idTokenVerifier .verify (jwt , options , true );
305
+ }
306
+
307
+ @ Test
308
+ public void shouldNotFailWhenOrganizationNameClaimIsRequiredAndHasSameValueInDifferentCase () throws Exception {
309
+ Map <String , Object > jwtBody = createJWTBody ();
310
+ jwtBody .put ("org_name" , "__tESt_OrG_nAme__" );
311
+ String token = createTestJWT ("none" , jwtBody );
312
+ Jwt jwt = new Jwt (token );
313
+ options .setOrganization (EXPECTED_ORGANIZATION_NAME );
314
+ idTokenVerifier .verify (jwt , options , true );
315
+ }
297
316
298
317
@ Test
299
318
public void shouldNotFailWhenOrganizationIdClaimIsMissingButNotRequired () throws Exception {
You can’t perform that action at this time.
0 commit comments