class 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);
			}
		}
	}

}

class IssuerClaimVerifierTest {

	private static final String DEFAULT_ISSUER;
	private IssuerClaimVerifier issuerClaimVerifier;

	@Test
	public void verifyWhenJwtClaimsSetContainsValidIssuerThenVerificationSucceeds() throws Exception {

		Map<String, Object> claims = new HashMap<String, Object>();
		claims.put("iss", DEFAULT_ISSUER);
		this.issuerClaimVerifier.verify(claims);
	}

}