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 of
AuthenticationRequiredHandler
for 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handle
(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
-
Constructor Details
-
RestAuthenticationRequiredHandler
public RestAuthenticationRequiredHandler()
-
-
Method Details
-
handle
public void handle(org.craftercms.commons.http.RequestContext context, AuthenticationException e) throws SecurityProviderException, IOException Description copied from interface:AuthenticationRequiredHandler
Handles the request when authentication is required.- Specified by:
handle
in interfaceAuthenticationRequiredHandler
- Parameters:
context
- the request contexte
- the exception with the reason for requiring authentication- Throws:
SecurityProviderException
IOException
-