Class AuthorizationErrorResponseExceptionHandler
java.lang.Object
io.micronaut.security.oauth2.endpoint.authorization.response.AuthorizationErrorResponseExceptionHandler
- All Implemented Interfaces:
 io.micronaut.http.server.exceptions.ExceptionHandler<AuthorizationErrorResponseException,io.micronaut.http.MutableHttpResponse<?>> 
@Singleton
public class AuthorizationErrorResponseExceptionHandler
extends Object
implements io.micronaut.http.server.exceptions.ExceptionHandler<AuthorizationErrorResponseException,io.micronaut.http.MutableHttpResponse<?>> 
An exception handler for 
AuthorizationErrorResponseException.- Since:
 - 1.2.0
 - Author:
 - Sergio del Amo
 
- 
Constructor Summary
ConstructorsConstructorDescriptionAuthorizationErrorResponseExceptionHandler(RedirectConfiguration redirectConfiguration, RedirectService redirectService, io.micronaut.http.server.exceptions.response.ErrorResponseProcessor<?> errorResponseProcessor)  - 
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetRedirectUri(io.micronaut.http.HttpRequest<?> request, AuthorizationErrorResponseException exception) io.micronaut.http.MutableHttpResponse<?>handle(io.micronaut.http.HttpRequest request, AuthorizationErrorResponseException exception) protected io.micronaut.http.MutableHttpResponse<?>httpResponseWithStatus(io.micronaut.http.HttpRequest<?> request, AuthorizationErrorResponseException exception) protected io.micronaut.http.MutableHttpResponse<?>httpResponseWithStatus(URI location) Builds a HTTP Response redirection to the supplied location.protected booleanshouldRedirect(io.micronaut.http.HttpRequest<?> request, AuthorizationErrorResponseException exception) Decides whether the request should be handled with a redirect. 
- 
Constructor Details
- 
AuthorizationErrorResponseExceptionHandler
public AuthorizationErrorResponseExceptionHandler(RedirectConfiguration redirectConfiguration, RedirectService redirectService, io.micronaut.http.server.exceptions.response.ErrorResponseProcessor<?> errorResponseProcessor) - Parameters:
 redirectConfiguration- Redirect ConfigurationredirectService- Redirect ServiceerrorResponseProcessor- Error Response Processor
 
 - 
 - 
Method Details
- 
handle
public io.micronaut.http.MutableHttpResponse<?> handle(io.micronaut.http.HttpRequest request, AuthorizationErrorResponseException exception) - Specified by:
 handlein interfaceio.micronaut.http.server.exceptions.ExceptionHandler<AuthorizationErrorResponseException,io.micronaut.http.MutableHttpResponse<?>> 
 - 
httpResponseWithStatus
@NonNull protected io.micronaut.http.MutableHttpResponse<?> httpResponseWithStatus(@NonNull URI location) Builds a HTTP Response redirection to the supplied location.- Parameters:
 location- The Uri to redirect to- Returns:
 - an HTTP response with the Uri as location
 
 - 
httpResponseWithStatus
@NonNull protected io.micronaut.http.MutableHttpResponse<?> httpResponseWithStatus(@NonNull io.micronaut.http.HttpRequest<?> request, @NonNull AuthorizationErrorResponseException exception) - Parameters:
 request- The requestexception- The exception- Returns:
 - The response to be used when a redirect is not appropriate
 
 - 
getRedirectUri
@NonNull protected String getRedirectUri(@NonNull io.micronaut.http.HttpRequest<?> request, @NonNull AuthorizationErrorResponseException exception) - Parameters:
 request- The requestexception- The exception- Returns:
 - The URI to redirect to
 
 - 
shouldRedirect
protected boolean shouldRedirect(@NonNull io.micronaut.http.HttpRequest<?> request, @NonNull AuthorizationErrorResponseException exception) Decides whether the request should be handled with a redirect.- Parameters:
 request- The HTTP Requestexception- The authorization exception- Returns:
 - true if the request accepts text/html
 
 
 -