public class NuxeoOAuth2ServiceProvider extends Object implements OAuth2ServiceProvider
| Modifier and Type | Field and Description | 
|---|---|
static String | 
CODE_URL_PARAMETER  | 
protected String | 
description  | 
static String | 
ERROR_URL_PARAMETER  | 
protected static com.google.api.client.http.HttpTransport | 
HTTP_TRANSPORT
Global instance of the HTTP transport. 
 | 
protected Long | 
id  | 
protected static com.google.api.client.json.JsonFactory | 
JSON_FACTORY
Global instance of the JSON factory. 
 | 
static String | 
SCHEMA  | 
protected String | 
serviceName  | 
protected OAuth2ServiceUserStore | 
serviceUserStore  | 
protected OAuth2TokenStore | 
tokenStore  | 
protected String | 
userAuthorizationURL  | 
| Constructor and Description | 
|---|
NuxeoOAuth2ServiceProvider()  | 
| Modifier and Type | Method and Description | 
|---|---|
protected String | 
getAuthorizationCode(javax.servlet.http.HttpServletRequest request)  | 
com.google.api.client.auth.oauth2.AuthorizationCodeFlow | 
getAuthorizationCodeFlow()  | 
String | 
getAuthorizationServerURL()  | 
String | 
getAuthorizationUrl(javax.servlet.http.HttpServletRequest request)
Returns the authorization URL 
 | 
String | 
getAuthorizationUrl(String serverURL)
Returns the authorization URL 
 | 
protected String | 
getCallbackUrl(javax.servlet.http.HttpServletRequest request)  | 
protected String | 
getCallbackUrl(String serverURL)  | 
String | 
getClientId()  | 
String | 
getClientSecret()  | 
OAuth2TokenStore | 
getCredentialDataStore()  | 
String | 
getDescription()  | 
protected String | 
getError(javax.servlet.http.HttpServletRequest request)  | 
Long | 
getId()  | 
protected String | 
getOrCreateServiceUser(javax.servlet.http.HttpServletRequest request,
                      String accessToken)
Retrieves or creates a service user. 
 | 
List<String> | 
getScopes()  | 
String | 
getServiceName()  | 
protected String | 
getServiceUserId(String key)
Returns the userId to use for token entries. 
 | 
protected OAuth2ServiceUserStore | 
getServiceUserStore()  | 
String | 
getTokenServerURL()  | 
String | 
getUserAuthorizationURL()  | 
com.google.api.client.auth.oauth2.Credential | 
handleAuthorizationCallback(javax.servlet.http.HttpServletRequest request)
Handles the authorization response and stores the token(s) 
 | 
boolean | 
isEnabled()  | 
boolean | 
isProviderAvailable()  | 
com.google.api.client.auth.oauth2.Credential | 
loadCredential(String user)
Load a credential from the token store with the userId returned by getServiceUser() as key. 
 | 
void | 
setAuthorizationServerURL(String authorizationServerURL)  | 
void | 
setClientId(String clientId)  | 
void | 
setClientSecret(String clientSecret)  | 
void | 
setDescription(String description)  | 
void | 
setEnabled(Boolean enabled)  | 
void | 
setId(Long id)  | 
void | 
setScopes(String... scopes)  | 
void | 
setServiceName(String serviceName)  | 
void | 
setTokenServerURL(String tokenServerURL)  | 
void | 
setUserAuthorizationURL(String userAuthorizationURL)  | 
public static final String SCHEMA
protected static final com.google.api.client.http.HttpTransport HTTP_TRANSPORT
protected static final com.google.api.client.json.JsonFactory JSON_FACTORY
public static final String CODE_URL_PARAMETER
public static final String ERROR_URL_PARAMETER
protected String serviceName
protected String description
protected String userAuthorizationURL
protected OAuth2ServiceUserStore serviceUserStore
protected OAuth2TokenStore tokenStore
public NuxeoOAuth2ServiceProvider()
public String getAuthorizationUrl(javax.servlet.http.HttpServletRequest request)
OAuth2ServiceProvidergetAuthorizationUrl in interface OAuth2ServiceProviderpublic String getAuthorizationUrl(String serverURL)
OAuth2ServiceProvidergetAuthorizationUrl in interface OAuth2ServiceProviderprotected String getCallbackUrl(javax.servlet.http.HttpServletRequest request)
protected String getCallbackUrl(String serverURL)
public com.google.api.client.auth.oauth2.Credential handleAuthorizationCallback(javax.servlet.http.HttpServletRequest request)
OAuth2ServiceProviderhandleAuthorizationCallback in interface OAuth2ServiceProviderpublic com.google.api.client.auth.oauth2.Credential loadCredential(String user)
loadCredential in interface OAuth2ServiceProviderprotected String getServiceUserId(String key)
protected String getOrCreateServiceUser(javax.servlet.http.HttpServletRequest request, String accessToken) throws IOException
IOExceptionpublic com.google.api.client.auth.oauth2.AuthorizationCodeFlow getAuthorizationCodeFlow()
protected OAuth2ServiceUserStore getServiceUserStore()
public OAuth2TokenStore getCredentialDataStore()
protected String getAuthorizationCode(javax.servlet.http.HttpServletRequest request)
public String getServiceName()
getServiceName in interface OAuth2ServiceProviderpublic Long getId()
getId in interface OAuth2ServiceProviderpublic String getDescription()
getDescription in interface OAuth2ServiceProviderpublic String getTokenServerURL()
getTokenServerURL in interface OAuth2ServiceProviderpublic String getUserAuthorizationURL()
getUserAuthorizationURL in interface OAuth2ServiceProviderpublic String getClientId()
getClientId in interface OAuth2ServiceProviderpublic String getClientSecret()
getClientSecret in interface OAuth2ServiceProviderpublic List<String> getScopes()
getScopes in interface OAuth2ServiceProviderpublic String getAuthorizationServerURL()
getAuthorizationServerURL in interface OAuth2ServiceProviderpublic boolean isEnabled()
isEnabled in interface OAuth2ServiceProviderpublic void setEnabled(Boolean enabled)
setEnabled in interface OAuth2ServiceProviderpublic boolean isProviderAvailable()
isProviderAvailable in interface OAuth2ServiceProviderpublic void setServiceName(String serviceName)
setServiceName in interface OAuth2ServiceProviderpublic void setId(Long id)
setId in interface OAuth2ServiceProviderpublic void setDescription(String description)
setDescription in interface OAuth2ServiceProviderpublic void setTokenServerURL(String tokenServerURL)
setTokenServerURL in interface OAuth2ServiceProviderpublic void setUserAuthorizationURL(String userAuthorizationURL)
setUserAuthorizationURL in interface OAuth2ServiceProviderpublic void setAuthorizationServerURL(String authorizationServerURL)
setAuthorizationServerURL in interface OAuth2ServiceProviderpublic void setClientId(String clientId)
setClientId in interface OAuth2ServiceProviderpublic void setClientSecret(String clientSecret)
setClientSecret in interface OAuth2ServiceProviderpublic void setScopes(String... scopes)
setScopes in interface OAuth2ServiceProviderCopyright © 2019 Nuxeo. All rights reserved.