Skip to content

Commit

Permalink
Add audience test
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <jiallian@amazon.com>
  • Loading branch information
RyanL1997 committed Oct 10, 2023
1 parent 4e24045 commit eef1957
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,19 @@ public void testWrongSubjectKey() throws Exception {
Assert.assertNull(credentials);
}

@Test
public void testMissingAudienceClaim() throws Exception {

final AuthCredentials credentials = extractCredentialsFromJwtHeader(
signingKeyB64Encoded,
claimsEncryptionKey,
Jwts.builder().setIssuer(clusterName).setSubject("Test User").claim("roles", "role1,role2"),
false
);

Assert.assertNull(credentials);
}

@Test
public void testExp() throws Exception {

Expand Down

0 comments on commit eef1957

Please sign in to comment.