@Singleton @Replaces(value=DefaultAuthorizationExceptionHandler.class) public class SessionAuthorizationExceptionHandler extends DefaultAuthorizationExceptionHandler
ExceptionHandler
for AuthorizationException
that
redirects to a configured URI.Constructor and Description |
---|
SessionAuthorizationExceptionHandler(SecuritySessionConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getRedirectUri(io.micronaut.http.HttpRequest<?> request,
AuthorizationException exception) |
io.micronaut.http.MutableHttpResponse<?> |
handle(io.micronaut.http.HttpRequest request,
AuthorizationException exception) |
protected io.micronaut.http.MutableHttpResponse<?> |
httpResponseWithUri(java.net.URI location)
Builds a HTTP Response redirection to the supplied location.
|
protected boolean |
shouldHandleRequest(io.micronaut.http.HttpRequest<?> request)
Decides whether the request should be handled with a redirect.
|
public SessionAuthorizationExceptionHandler(SecuritySessionConfiguration configuration)
configuration
- The session configurationpublic io.micronaut.http.MutableHttpResponse<?> handle(io.micronaut.http.HttpRequest request, AuthorizationException exception)
handle
in interface io.micronaut.http.server.exceptions.ExceptionHandler<AuthorizationException,io.micronaut.http.MutableHttpResponse<?>>
handle
in class DefaultAuthorizationExceptionHandler
protected boolean shouldHandleRequest(io.micronaut.http.HttpRequest<?> request)
request
- The HTTP Requestprotected java.lang.String getRedirectUri(io.micronaut.http.HttpRequest<?> request, AuthorizationException exception)
request
- The requestexception
- The exceptionprotected io.micronaut.http.MutableHttpResponse<?> httpResponseWithUri(java.net.URI location)
location
- The Uri to redirect to