Class RestAuthenticationRequiredHandler
- java.lang.Object
-
- org.craftercms.security.utils.handlers.AbstractRestHandlerBase
-
- org.craftercms.security.authentication.impl.RestAuthenticationRequiredHandler
-
- All Implemented Interfaces:
AuthenticationRequiredHandler
public class RestAuthenticationRequiredHandler extends AbstractRestHandlerBase implements AuthenticationRequiredHandler
Implementation ofAuthenticationRequiredHandlerfor REST based applications, which returns a 401 UNAUTHORIZED status with the authentication exception message.- Author:
- avasquez
-
-
Field Summary
-
Fields inherited from class org.craftercms.security.utils.handlers.AbstractRestHandlerBase
responseWriter
-
-
Constructor Summary
Constructors Constructor Description RestAuthenticationRequiredHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandle(org.craftercms.commons.http.RequestContext context, AuthenticationException e)Handles the request when authentication is required.-
Methods inherited from class org.craftercms.security.utils.handlers.AbstractRestHandlerBase
sendErrorMessage, sendMessage, sendObject, setResponseWriter
-
-
-
-
Method Detail
-
handle
public void handle(org.craftercms.commons.http.RequestContext context, AuthenticationException e) throws SecurityProviderException, IOExceptionDescription copied from interface:AuthenticationRequiredHandlerHandles the request when authentication is required.- Specified by:
handlein interfaceAuthenticationRequiredHandler- Parameters:
context- the request contexte- the exception with the reason for requiring authentication- Throws:
SecurityProviderExceptionIOException
-
-