public class RestAuthenticationRequiredHandler extends AbstractRestHandlerBase implements AuthenticationRequiredHandler
AuthenticationRequiredHandler
for REST based
applications, which returns a 401 UNAUTHORIZED status with the authentication exception message.responseWriter
Constructor and Description |
---|
RestAuthenticationRequiredHandler() |
Modifier and Type | Method and Description |
---|---|
void |
handle(org.craftercms.commons.http.RequestContext context,
AuthenticationException e)
Handles the request when authentication is required.
|
sendErrorMessage, sendMessage, sendObject, setResponseWriter
public void handle(org.craftercms.commons.http.RequestContext context, AuthenticationException e) throws SecurityProviderException, IOException
AuthenticationRequiredHandler
handle
in interface AuthenticationRequiredHandler
context
- the request contexte
- the exception with the reason for requiring authenticationSecurityProviderException
IOException
Copyright © 2023 CrafterCMS. All rights reserved.