Package io.dropwizard.auth
Interface UnauthorizedHandler
-
- All Known Implementing Classes:
DefaultUnauthorizedHandler
,JSONUnauthorizedHandler
public interface UnauthorizedHandler
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default RuntimeException
buildException(String prefix, String realm)
This method allows overriding the exception thrown from anAuthFilter
instance.default @Nullable javax.ws.rs.core.Response
buildResponse(String prefix, String realm)
-
-
-
Method Detail
-
buildResponse
default @Nullable javax.ws.rs.core.Response buildResponse(String prefix, String realm)
-
buildException
default RuntimeException buildException(String prefix, String realm)
This method allows overriding the exception thrown from anAuthFilter
instance. This provides the possibility to catch auth exceptions in a customExceptionMapper
. To process the exception in a customExceptionMapper
, the response entity MUST be empty when using a subclass ofWebApplicationException
. Else theExceptionMapper
won't get invoked. The default implementation of this method creates aWebApplicationException
containing the response built inbuildResponse(String, String)
.- Since:
- 2.1.0
-
-