Ensuring consistency in error handling of opaque providers/managers
The OpaqueTokenAuthenticationProvider now propagates the cause of introspection exceptions in the same way that the reactive OpaqueTokenReactiveAuthenticationManager does. Fixed a final field warning on both OpaqueTokenAuthenticationProvider and OpaqueTokenReactiveAuthenticationManager.
This commit is contained in:
parent
e9d5bbba34
commit
7ccc915b2b
|
@ -66,7 +66,7 @@ public final class OpaqueTokenAuthenticationProvider implements AuthenticationPr
|
|||
|
||||
private final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private OpaqueTokenIntrospector introspector;
|
||||
private final OpaqueTokenIntrospector introspector;
|
||||
|
||||
/**
|
||||
* Creates a {@code OpaqueTokenAuthenticationProvider} with the provided parameters
|
||||
|
@ -104,10 +104,10 @@ public final class OpaqueTokenAuthenticationProvider implements AuthenticationPr
|
|||
}
|
||||
catch (BadOpaqueTokenException failed) {
|
||||
this.logger.debug("Failed to authenticate since token was invalid");
|
||||
throw new InvalidBearerTokenException(failed.getMessage());
|
||||
throw new InvalidBearerTokenException(failed.getMessage(), failed);
|
||||
}
|
||||
catch (OAuth2IntrospectionException failed) {
|
||||
throw new AuthenticationServiceException(failed.getMessage());
|
||||
throw new AuthenticationServiceException(failed.getMessage(), failed);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ import org.springframework.util.Assert;
|
|||
*/
|
||||
public class OpaqueTokenReactiveAuthenticationManager implements ReactiveAuthenticationManager {
|
||||
|
||||
private ReactiveOpaqueTokenIntrospector introspector;
|
||||
private final ReactiveOpaqueTokenIntrospector introspector;
|
||||
|
||||
/**
|
||||
* Creates a {@code OpaqueTokenReactiveAuthenticationManager} with the provided
|
||||
|
|
Loading…
Reference in New Issue