IssuerClaimVerifier implements JwtClaimsSetVerifier { @Override public void verify(Map<String, Object> claims) throws InvalidTokenException { if (!CollectionUtils.isEmpty(claims) && claims.containsKey(ISS_CLAIM)) { String jwtIssuer = (String)claims.get(ISS_CLAIM); if (!jwtIssuer.equals(this.issuer.toString())) { throw new InvalidTokenException("Invalid Issuer (iss) claim: " + jwtIssuer); } } } IssuerClaimVerifier(URL issuer); @Override void verify(Map<String, Object> claims);  }
@Test public void verifyWhenJwtClaimsSetContainsValidIssuerThenVerificationSucceeds() throws Exception { Map<String, Object> claims = new HashMap<String, Object>(); claims.put("iss", DEFAULT_ISSUER); this.issuerClaimVerifier.verify(claims); }
@Test(expected = InvalidTokenException.class) public void verifyWhenJwtClaimsSetContainsInvalidIssuerThenVerificationFails() throws Exception { Map<String, Object> claims = new HashMap<String, Object>(); claims.put("iss", "https: this.issuerClaimVerifier.verify(claims); }