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)
OAuth2ServiceProvider
getAuthorizationUrl
in interface OAuth2ServiceProvider
public String getAuthorizationUrl(String serverURL)
OAuth2ServiceProvider
getAuthorizationUrl
in interface OAuth2ServiceProvider
protected 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)
OAuth2ServiceProvider
handleAuthorizationCallback
in interface OAuth2ServiceProvider
public com.google.api.client.auth.oauth2.Credential loadCredential(String user)
loadCredential
in interface OAuth2ServiceProvider
protected String getServiceUserId(String key)
protected String getOrCreateServiceUser(javax.servlet.http.HttpServletRequest request, String accessToken) throws IOException
IOException
public 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 OAuth2ServiceProvider
public Long getId()
getId
in interface OAuth2ServiceProvider
public String getDescription()
getDescription
in interface OAuth2ServiceProvider
public String getTokenServerURL()
getTokenServerURL
in interface OAuth2ServiceProvider
public String getUserAuthorizationURL()
getUserAuthorizationURL
in interface OAuth2ServiceProvider
public String getClientId()
getClientId
in interface OAuth2ServiceProvider
public String getClientSecret()
getClientSecret
in interface OAuth2ServiceProvider
public List<String> getScopes()
getScopes
in interface OAuth2ServiceProvider
public String getAuthorizationServerURL()
getAuthorizationServerURL
in interface OAuth2ServiceProvider
public boolean isEnabled()
isEnabled
in interface OAuth2ServiceProvider
public void setEnabled(Boolean enabled)
setEnabled
in interface OAuth2ServiceProvider
public boolean isProviderAvailable()
isProviderAvailable
in interface OAuth2ServiceProvider
public void setServiceName(String serviceName)
setServiceName
in interface OAuth2ServiceProvider
public void setId(Long id)
setId
in interface OAuth2ServiceProvider
public void setDescription(String description)
setDescription
in interface OAuth2ServiceProvider
public void setTokenServerURL(String tokenServerURL)
setTokenServerURL
in interface OAuth2ServiceProvider
public void setUserAuthorizationURL(String userAuthorizationURL)
setUserAuthorizationURL
in interface OAuth2ServiceProvider
public void setAuthorizationServerURL(String authorizationServerURL)
setAuthorizationServerURL
in interface OAuth2ServiceProvider
public void setClientId(String clientId)
setClientId
in interface OAuth2ServiceProvider
public void setClientSecret(String clientSecret)
setClientSecret
in interface OAuth2ServiceProvider
public void setScopes(String... scopes)
setScopes
in interface OAuth2ServiceProvider
Copyright © 2017 Nuxeo. All rights reserved.