|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wewebu.ow.server.ecmimpl.opencmis.alfresco.OwCMISAlfrescoOAuthInterceptor
public class OwCMISAlfrescoOAuthInterceptor
Implementation of AuthProviderFactory for OAuth handling.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Field Summary | |
---|---|
static String |
EL_ACCESS_URL
Configuration node of URL where to get AccessToken |
static String |
EL_CALLBACK_URL
Configuration node for Client redirect/callback URL |
static String |
EL_CLIENT_ID
Configuration node for CLIENT ID |
static String |
EL_CLIENT_SECRETE
Configuration node for client secrete |
static String |
EL_GRANT_URL
Configuration node of URL where to redirect to get GRANT from User |
static String |
EL_REFRESH_URL
Configuration Node for refresh URL |
static String |
EL_URL_ENCODING
(optional) Configuration node to define the value encoding URL-parameter, by default UTF-8 |
static String |
PARAM_CLIENT_ID
|
static String |
PARAM_CODE
|
static String |
PARAM_REDIRECT_URI
|
static String |
PARAM_RESPONSE_TYPE
|
static String |
PARAM_SCOPE
|
Constructor Summary | |
---|---|
OwCMISAlfrescoOAuthInterceptor()
|
Method Summary | |
---|---|
protected void |
appendParameter(StringBuilder url,
String paramName,
String paramVal)
Helper method for creation of URL, will attach the parameter name and value to it and escape the value using UTF-8 base. |
org.apache.chemistry.opencmis.commons.spi.AuthenticationProvider |
createAuthenticationProvider(Map<String,?> information)
Called to create a new Authentication provider which should be used in communication between CMIS client and server. |
protected String |
getConfigValue(String configName)
|
protected String |
getConfigValue(String configName,
String defaultValue)
|
protected String |
getGrantToken()
Get the grant token which is used for access token retrieval. |
void |
init(com.wewebu.ow.server.util.OwXMLUtil configNode)
Initialization of AuthProviderFactory instance with corresponding configuration. |
boolean |
onRequest(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Called before login page is rendered, can be used for redirect or preparation of this instance. |
protected boolean |
stageOne(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Stage one of OAuth is to redirect to grant URL and wait for user grant token. |
protected boolean |
stageTwo(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Stage two is to retrieve access token if needed. We will use the AuthenticationProvider factory method of Alfresco extension, so that the refresh token handling will be done through the created AuthenticationProvider. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String EL_CLIENT_ID
public static final String EL_CLIENT_SECRETE
public static final String EL_CALLBACK_URL
public static final String EL_GRANT_URL
public static final String EL_ACCESS_URL
public static final String EL_REFRESH_URL
public static final String EL_URL_ENCODING
public static final String PARAM_CODE
public static final String PARAM_REDIRECT_URI
public static final String PARAM_SCOPE
public static final String PARAM_RESPONSE_TYPE
public static final String PARAM_CLIENT_ID
Constructor Detail |
---|
public OwCMISAlfrescoOAuthInterceptor()
Method Detail |
---|
public void init(com.wewebu.ow.server.util.OwXMLUtil configNode) throws com.wewebu.ow.server.exceptions.OwException
OwCMISAuthenticationInterceptor
init
in interface OwCMISAuthenticationInterceptor
configNode
- OwXMLUtil node which represents AuthProviderFactory configuration
com.wewebu.ow.server.exceptions.OwException
public org.apache.chemistry.opencmis.commons.spi.AuthenticationProvider createAuthenticationProvider(Map<String,?> information) throws com.wewebu.ow.server.exceptions.OwException
OwCMISAuthenticationInterceptor
createAuthenticationProvider
in interface OwCMISAuthenticationInterceptor
information
- Map current available informations for OpenCMIS Session creation
com.wewebu.ow.server.exceptions.OwException
public boolean onRequest(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws com.wewebu.ow.server.exceptions.OwException, IOException
OwCMISAuthenticationInterceptor
If true is returned, by default a login is processed through network.
The login will call the OwCMISAuthenticationInterceptor.createAuthenticationProvider(Map)
and
verify against back-end if login was successful.
onRequest
in interface OwCMISAuthenticationInterceptor
req
- HttpServletRequestresp
- HttpServletResponse
com.wewebu.ow.server.exceptions.OwException
IOException
protected boolean stageOne(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws com.wewebu.ow.server.exceptions.OwException, IOException
req
- HttpServletRequestresp
- HttpServletResponse
com.wewebu.ow.server.exceptions.OwException
IOException
protected boolean stageTwo(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws com.wewebu.ow.server.exceptions.OwException
req
- HttpServletRequestresp
- HttpServletResponse
com.wewebu.ow.server.exceptions.OwException
protected String getConfigValue(String configName)
protected String getConfigValue(String configName, String defaultValue)
protected void appendParameter(StringBuilder url, String paramName, String paramVal) throws UnsupportedEncodingException
url
- StringBuilder URLparamName
- StringparamVal
- String
UnsupportedEncodingException
protected String getGrantToken()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |