Browse Source

Fix Failing Test

Closes gh-14467
pull/13082/head
Josh Cummings 2 years ago
parent
commit
27ebeefb14
No known key found for this signature in database
GPG Key ID: A306A51F43B8E5A5
  1. 19
      config/src/main/java/org/springframework/security/config/web/server/OidcBackChannelLogoutReactiveAuthenticationManager.java

19
config/src/main/java/org/springframework/security/config/web/server/OidcBackChannelLogoutReactiveAuthenticationManager.java

@ -85,17 +85,14 @@ final class OidcBackChannelLogoutReactiveAuthenticationManager implements Reacti @@ -85,17 +85,14 @@ final class OidcBackChannelLogoutReactiveAuthenticationManager implements Reacti
private Mono<Jwt> decode(ClientRegistration registration, String token) {
ReactiveJwtDecoder logoutTokenDecoder = this.logoutTokenDecoderFactory.createDecoder(registration);
try {
return logoutTokenDecoder.decode(token);
}
catch (BadJwtException failed) {
OAuth2Error error = new OAuth2Error(OAuth2ErrorCodes.INVALID_REQUEST, failed.getMessage(),
"https://openid.net/specs/openid-connect-backchannel-1_0.html#Validation");
return Mono.error(new OAuth2AuthenticationException(error, failed));
}
catch (Exception failed) {
return Mono.error(new AuthenticationServiceException(failed.getMessage(), failed));
}
return logoutTokenDecoder.decode(token).onErrorResume(Exception.class, (ex) -> {
if (ex instanceof BadJwtException) {
OAuth2Error error = new OAuth2Error(OAuth2ErrorCodes.INVALID_REQUEST, ex.getMessage(),
"https://openid.net/specs/openid-connect-backchannel-1_0.html#Validation");
return Mono.error(new OAuth2AuthenticationException(error, ex));
}
return Mono.error(new AuthenticationServiceException(ex.getMessage(), ex));
});
}
/**

Loading…
Cancel
Save