Package org.nuxeo.ecm.tokenauth.servlet
Class TokenAuthenticationServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.nuxeo.ecm.tokenauth.servlet.TokenAuthenticationServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
public class TokenAuthenticationServlet
extends jakarta.servlet.http.HttpServlet
Servlet that allows to get a unique authentication token given the request Principal and some device information
passed as request parameters: application name, device id, device description, permission. An error response will be
sent with a 400 status code if one of the required parameters is null or empty. All parameters are required except
for the device description.
The token is provided by the TokenAuthenticationService
.
- Since:
- 5.7
- Author:
- Antoine Taillefer ([email protected])
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
doGet
(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) protected void
sendTextResponse
(jakarta.servlet.http.HttpServletResponse resp, String textResponse, int statusCode) Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, init, service, service
Methods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Field Details
-
TOKEN_AUTH_PLUGIN_NAME
- See Also:
-
APPLICATION_NAME_PARAM
- See Also:
-
DEVICE_ID_PARAM
- See Also:
-
DEVICE_DESCRIPTION_PARAM
- See Also:
-
PERMISSION_PARAM
- See Also:
-
REVOKE_PARAM
- See Also:
-
-
Constructor Details
-
TokenAuthenticationServlet
public TokenAuthenticationServlet()
-
-
Method Details
-
doGet
public void doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws jakarta.servlet.ServletException, IOException - Overrides:
doGet
in classjakarta.servlet.http.HttpServlet
- Throws:
jakarta.servlet.ServletException
IOException
-
sendTextResponse
protected void sendTextResponse(jakarta.servlet.http.HttpServletResponse resp, String textResponse, int statusCode) throws IOException - Throws:
IOException
-