Skip to content

Commit

Permalink
Update IdTokenVerifierTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
poovamraj committed Jul 18, 2023
1 parent 6972a5f commit b087c92
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,16 @@ public void shouldNotFailWhenOrganizationNameClaimIsRequiredAndHasSameValue() th

@Test
public void shouldFailWhenInputClaimHasDifferentCaseThanOrgNameReceived() throws Exception {
Map<String, Object> jwtBody = createJWTBody();
jwtBody.put("org_name", "__tESt_OrG_nAme__");
String token = createTestJWT("none", jwtBody);
Jwt jwt = new Jwt(token);
options.setOrganization(EXPECTED_ORGANIZATION_NAME);
idTokenVerifier.verify(jwt, options, true);
String message = "Organization Name (org_name) claim mismatch in the ID token; expected \"__test_org_name__\", found \"__tESt_OrG_nAme__\"";
Exception e = Assert.assertThrows(message, OrgNameClaimMismatchException.class, () -> {
Map<String, Object> jwtBody = createJWTBody();
jwtBody.put("org_name", "__tESt_OrG_nAme__");
String token = createTestJWT("none", jwtBody);
Jwt jwt = new Jwt(token);
options.setOrganization(EXPECTED_ORGANIZATION_NAME);
idTokenVerifier.verify(jwt, options, true);
});
assertEquals("com.auth0.android.provider.TokenValidationException: " + message, e.toString());
}

@Test
Expand Down

0 comments on commit b087c92

Please sign in to comment.