bugfix in assertion processor
parent
2e2c0e8e6c
commit
c1d33bb55b
|
@ -85,7 +85,7 @@ public class JwtBearerAuthenticationProvider implements AuthenticationProvider {
|
||||||
// check the signature with nimbus
|
// check the signature with nimbus
|
||||||
JWSVerifier verifier = getVerifierForClient(client);
|
JWSVerifier verifier = getVerifierForClient(client);
|
||||||
JWSObject jws = JWSObject.parse(jwtAuth.getJwt().toString());
|
JWSObject jws = JWSObject.parse(jwtAuth.getJwt().toString());
|
||||||
if (verifier != null && !jws.verify(verifier)) {
|
if (verifier == null && !jws.verify(verifier)) {
|
||||||
throw new AuthenticationServiceException("Invalid signature");
|
throw new AuthenticationServiceException("Invalid signature");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ public class JwtBearerAuthenticationProvider implements AuthenticationProvider {
|
||||||
// check audience
|
// check audience
|
||||||
if (jwtClaims.getAudience() == null) {
|
if (jwtClaims.getAudience() == null) {
|
||||||
throw new AuthenticationServiceException("Assertion token audience is 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());
|
throw new AuthenticationServiceException("Audience does not match, expected " + config.getIssuer() + " got " + jwtClaims.getAudience());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue