Package org.nuxeo.ecm.tokenauth.servlet
Class TokenAuthenticationServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.nuxeo.ecm.tokenauth.servlet.TokenAuthenticationServlet
-
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class TokenAuthenticationServlet extends javax.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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
APPLICATION_NAME_PARAM
static String
DEVICE_DESCRIPTION_PARAM
static String
DEVICE_ID_PARAM
static String
PERMISSION_PARAM
static String
REVOKE_PARAM
static String
TOKEN_AUTH_PLUGIN_NAME
-
Constructor Summary
Constructors Constructor Description TokenAuthenticationServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
protected void
sendTextResponse(javax.servlet.http.HttpServletResponse resp, String textResponse, int statusCode)
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
-
-
-
-
Field Detail
-
TOKEN_AUTH_PLUGIN_NAME
public static final String TOKEN_AUTH_PLUGIN_NAME
- See Also:
- Constant Field Values
-
APPLICATION_NAME_PARAM
public static final String APPLICATION_NAME_PARAM
- See Also:
- Constant Field Values
-
DEVICE_ID_PARAM
public static final String DEVICE_ID_PARAM
- See Also:
- Constant Field Values
-
DEVICE_DESCRIPTION_PARAM
public static final String DEVICE_DESCRIPTION_PARAM
- See Also:
- Constant Field Values
-
PERMISSION_PARAM
public static final String PERMISSION_PARAM
- See Also:
- Constant Field Values
-
REVOKE_PARAM
public static final String REVOKE_PARAM
- See Also:
- Constant Field Values
-
-
Method Detail
-
doGet
public void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
- Overrides:
doGet
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
sendTextResponse
protected void sendTextResponse(javax.servlet.http.HttpServletResponse resp, String textResponse, int statusCode) throws IOException
- Throws:
IOException
-
-