@Singleton public class DefaultAuthorizationExceptionHandler extends java.lang.Object implements io.micronaut.http.server.exceptions.ExceptionHandler<AuthorizationException,io.micronaut.http.MutableHttpResponse<?>>
AuthorizationException
.Constructor and Description |
---|
DefaultAuthorizationExceptionHandler()
Default constructor.
|
DefaultAuthorizationExceptionHandler(RedirectConfiguration redirectConfiguration,
PriorToLoginPersistence priorToLoginPersistence) |
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<?> |
httpResponseWithStatus(io.micronaut.http.HttpRequest request,
AuthorizationException exception) |
protected io.micronaut.http.MutableHttpResponse<?> |
httpResponseWithStatus(java.net.URI location)
Builds a HTTP Response redirection to the supplied location.
|
protected boolean |
shouldRedirect(io.micronaut.http.HttpRequest<?> request,
AuthorizationException exception)
Decides whether the request should be handled with a redirect.
|
public DefaultAuthorizationExceptionHandler()
@Inject public DefaultAuthorizationExceptionHandler(RedirectConfiguration redirectConfiguration, @Nullable PriorToLoginPersistence priorToLoginPersistence)
redirectConfiguration
- Redirect configurationpriorToLoginPersistence
- Persistence mechanism to redirect to prior login urlpublic 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<?>>
protected io.micronaut.http.MutableHttpResponse<?> httpResponseWithStatus(io.micronaut.http.HttpRequest request, AuthorizationException exception)
request
- The requestexception
- The exceptionprotected boolean shouldRedirect(io.micronaut.http.HttpRequest<?> request, AuthorizationException exception)
request
- The HTTP Requestexception
- The authorization exceptionprotected java.lang.String getRedirectUri(io.micronaut.http.HttpRequest<?> request, AuthorizationException exception)
request
- The requestexception
- The exceptionprotected io.micronaut.http.MutableHttpResponse<?> httpResponseWithStatus(java.net.URI location)
location
- The Uri to redirect to