public class OwCMISAlfrescoOAuthInterceptor extends OwCMISCredentialsAuthenticator
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
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
OwCMISAlfrescoOAuthInterceptor(com.wewebu.ow.server.conf.OwBaseInitializer initializer) |
OwCMISAlfrescoOAuthInterceptor(OwCMISNetwork network) |
Modifier and Type | Method and Description |
---|---|
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,String> information)
Called to create a new Authentication provider which should be used in
communication between CMIS client and server.
|
org.alfresco.wd.ext.restlet.auth.OwRestletAuthenticationHandler |
createRestletAuthenticationHandler(OwCMISCredentials cred)
Factory to create an instance of OwCMISRestletAuthenticationHandler,
which is used in for authentication handling in non-CMIS calls.
|
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. |
authenticate, createCredentials
buildOpenCmisParameters, createLDAPConnector, getBaseInitialzier, getNetwork, getNetworkConfiguration, processRendering
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
public OwCMISAlfrescoOAuthInterceptor(com.wewebu.ow.server.conf.OwBaseInitializer initializer)
public OwCMISAlfrescoOAuthInterceptor(OwCMISNetwork network)
public void init(com.wewebu.ow.server.util.OwXMLUtil configNode) throws com.wewebu.ow.server.exceptions.OwException
OwCMISAuthenticationInterceptor
init
in interface OwCMISAuthenticationInterceptor
init
in class OwCMISAbstractAuthenticator
configNode
- OwXMLUtil node which represents AuthProviderFactory configurationcom.wewebu.ow.server.exceptions.OwException
public org.apache.chemistry.opencmis.commons.spi.AuthenticationProvider createAuthenticationProvider(Map<String,String> information) throws com.wewebu.ow.server.exceptions.OwException
OwCMISAuthenticationInterceptor
createAuthenticationProvider
in interface OwCMISAuthenticationInterceptor
createAuthenticationProvider
in class OwCMISAbstractAuthenticator
information
- Map current available informations for OpenCMIS Session creationcom.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
onRequest
in class OwCMISAbstractAuthenticator
req
- HttpServletRequestresp
- HttpServletResponsecom.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
- HttpServletResponsecom.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
- HttpServletResponsecom.wewebu.ow.server.exceptions.OwException
protected void appendParameter(StringBuilder url, String paramName, String paramVal) throws UnsupportedEncodingException
url
- StringBuilder URLparamName
- StringparamVal
- StringUnsupportedEncodingException
protected String getGrantToken()
public org.alfresco.wd.ext.restlet.auth.OwRestletAuthenticationHandler createRestletAuthenticationHandler(OwCMISCredentials cred) throws com.wewebu.ow.server.exceptions.OwException
OwCMISCredentialsAuthenticator
By Default returns OwCMISBasicRestletAuthenticationHandler which is an HTTP-Basic authentication handler.
createRestletAuthenticationHandler
in interface OwCMISAuthenticationInterceptor
createRestletAuthenticationHandler
in class OwCMISCredentialsAuthenticator
cred
- OwCMISCredentialscom.wewebu.ow.server.exceptions.OwException
- if not possible to create instanceCopyright © 2014 Alfresco Business Solutions. All Rights Reserved.