Package net.ltgt.oidc.servlet
Class RevokingOAuthTokensHandler
java.lang.Object
net.ltgt.oidc.servlet.RevokingOAuthTokensHandler
- All Implemented Interfaces:
OAuthTokensHandler
An
OAuthTokensHandler that immediately (though asynchronously) revokes the access token.
This is the default handler used by the CallbackServlet when no specific handler has
been configured, using the globally
configured HTTP request sender.
- See Also:
-
Field Summary
Fields inherited from interface net.ltgt.oidc.servlet.OAuthTokensHandler
CONTEXT_ATTRIBUTE_NAME -
Constructor Summary
ConstructorsConstructorDescriptionRevokingOAuthTokensHandler(Configuration configuration) Constructs a revoking token handler with the given configuration.RevokingOAuthTokensHandler(Configuration configuration, @Nullable HTTPRequestSender httpRequestSender) Constructs a revoking token handler with the given configuration and HTTP request sender.RevokingOAuthTokensHandler(Configuration configuration, @Nullable HTTPRequestSender httpRequestSender, Executor executor) Constructs a revoking token handler with the given configuration, HTTP executor sender, and executor.RevokingOAuthTokensHandler(Configuration configuration, Executor executor) Constructs a revoking token handler with the given configuration and executor, and no HTTP executor sender. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidhandleError(HTTPResponse response) Handles an unsuccessful response to the token revocation request.protected voidHandles an exception happening in the asynchronous revocation task.voidtokensAcquired(AccessTokenResponse tokenResponse, HttpSession session) Called by theCallbackServletbefore it forgets about the tokens.
-
Constructor Details
-
RevokingOAuthTokensHandler
Constructs a revoking token handler with the given configuration.The asynchronous task will be executed in the
ForkJoinPool.commonPool(). -
RevokingOAuthTokensHandler
public RevokingOAuthTokensHandler(Configuration configuration, @Nullable HTTPRequestSender httpRequestSender) Constructs a revoking token handler with the given configuration and HTTP request sender.The asynchronous task will be executed in the
ForkJoinPool.commonPool(). -
RevokingOAuthTokensHandler
Constructs a revoking token handler with the given configuration and executor, and no HTTP executor sender. -
RevokingOAuthTokensHandler
public RevokingOAuthTokensHandler(Configuration configuration, @Nullable HTTPRequestSender httpRequestSender, Executor executor) Constructs a revoking token handler with the given configuration, HTTP executor sender, and executor.
-
-
Method Details
-
tokensAcquired
Description copied from interface:OAuthTokensHandlerCalled by theCallbackServletbefore it forgets about the tokens.- Specified by:
tokensAcquiredin interfaceOAuthTokensHandler- Parameters:
tokenResponse- The token response, containing the OAuth tokens and possibly some custom parameters
-
handleError
Handles an exception happening in the asynchronous revocation task.The default implementation re-throws the exception, possibly wrapped in an
UncheckedIOExceptionor aRuntimeException. -
handleError
Handles an unsuccessful response to the token revocation request.The default implementation does nothing.
-