Class NuxeoOAuth1Servlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.nuxeo.ecm.platform.ui.web.auth.oauth.NuxeoOAuth1Servlet
-
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class NuxeoOAuth1Servlet extends javax.servlet.http.HttpServlet
Servlet for the /oauth endpoint.- Since:
- 10.3
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
APPLICATION_X_WWW_FORM_URLENCODED
static String
DURATION_PARAM
static String
ENDPOINT_ACCESS_TOKEN
static String
ENDPOINT_AUTHORIZE
static String
ENDPOINT_REQUEST_TOKEN
static String
GRANT_PAGE
static String
LOGIN_PAGE
static String
NUXEO_LOGIN_PARAM
static String
OAUTH_CALLBACK_CONFIRMED
static String
OAUTH_INFO_SESSION_KEY
static String
OAUTH_VERIFIER
-
Constructor Summary
Constructors Constructor Description NuxeoOAuth1Servlet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected void
doGetAccessToken(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected void
doGetAuthorize(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Generates a request token, redirects to the Nuxeo login page, and provides a later redirect URL to the OAuth grant page.protected void
doGetRequestToken(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected void
doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected void
doPostAuthorize(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Adds a verifier and username to the request token and redirects to the callback URL.protected static String
urlEncode(String string)
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Field Detail
-
ENDPOINT_REQUEST_TOKEN
public static final String ENDPOINT_REQUEST_TOKEN
- See Also:
- Constant Field Values
-
ENDPOINT_AUTHORIZE
public static final String ENDPOINT_AUTHORIZE
- See Also:
- Constant Field Values
-
ENDPOINT_ACCESS_TOKEN
public static final String ENDPOINT_ACCESS_TOKEN
- See Also:
- Constant Field Values
-
OAUTH_VERIFIER
public static final String OAUTH_VERIFIER
- See Also:
- Constant Field Values
-
OAUTH_CALLBACK_CONFIRMED
public static final String OAUTH_CALLBACK_CONFIRMED
- See Also:
- Constant Field Values
-
NUXEO_LOGIN_PARAM
public static final String NUXEO_LOGIN_PARAM
- See Also:
- Constant Field Values
-
DURATION_PARAM
public static final String DURATION_PARAM
- See Also:
- Constant Field Values
-
OAUTH_INFO_SESSION_KEY
public static final String OAUTH_INFO_SESSION_KEY
- See Also:
- Constant Field Values
-
GRANT_PAGE
public static final String GRANT_PAGE
- See Also:
- Constant Field Values
-
LOGIN_PAGE
public static final String LOGIN_PAGE
- See Also:
- Constant Field Values
-
APPLICATION_X_WWW_FORM_URLENCODED
public static final String APPLICATION_X_WWW_FORM_URLENCODED
- See Also:
- Constant Field Values
-
-
Method Detail
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
- Overrides:
doGet
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
doPost
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
- Overrides:
doPost
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
doGetAuthorize
protected void doGetAuthorize(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
Generates a request token, redirects to the Nuxeo login page, and provides a later redirect URL to the OAuth grant page.- Throws:
IOException
-
doPostAuthorize
protected void doPostAuthorize(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
Adds a verifier and username to the request token and redirects to the callback URL.- Throws:
IOException
-
doGetRequestToken
protected void doGetRequestToken(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
- Throws:
IOException
-
doGetAccessToken
protected void doGetAccessToken(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
- Throws:
IOException
-
-