bugfix in assertion processor

pull/263/merge
Justin Richer 2013-01-30 14:22:28 -05:00
parent 2e2c0e8e6c
commit c1d33bb55b
1 changed files with 2 additions and 2 deletions

View File

@ -85,7 +85,7 @@ public class JwtBearerAuthenticationProvider implements AuthenticationProvider {
// check the signature with nimbus
JWSVerifier verifier = getVerifierForClient(client);
JWSObject jws = JWSObject.parse(jwtAuth.getJwt().toString());
if (verifier != null && !jws.verify(verifier)) {
if (verifier == null && !jws.verify(verifier)) {
throw new AuthenticationServiceException("Invalid signature");
}
@ -118,7 +118,7 @@ public class JwtBearerAuthenticationProvider implements AuthenticationProvider {
// check audience
if (jwtClaims.getAudience() == null) {
throw new AuthenticationServiceException("Assertion token audience is null");
} else if (!jwtClaims.getAudience().equals(config.getIssuer())) {
} else if (!jwtClaims.getAudience().contains(config.getIssuer())) {
throw new AuthenticationServiceException("Audience does not match, expected " + config.getIssuer() + " got " + jwtClaims.getAudience());
}