Class NuxeoOAuth2ServiceProvider
java.lang.Object
org.nuxeo.ecm.platform.oauth2.providers.NuxeoOAuth2ServiceProvider
- All Implemented Interfaces:
OAuth2ServiceProvider
- Direct Known Subclasses:
AbstractOAuth2UserEmailProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected Stringstatic final Stringprotected static final com.google.api.client.http.HttpTransportGlobal instance of the HTTP transport.protected Longprotected static final com.google.api.client.json.JsonFactoryGlobal instance of the JSON factory.static final Stringprotected Stringprotected OAuth2ServiceUserStoreprotected OAuth2TokenStoreprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetAuthorizationCode(jakarta.servlet.http.HttpServletRequest request) com.google.api.client.auth.oauth2.AuthorizationCodeFlowgetAuthorizationUrl(jakarta.servlet.http.HttpServletRequest request) Returns the authorization URLgetAuthorizationUrl(String serverURL) Returns the authorization URLprotected StringgetCallbackUrl(jakarta.servlet.http.HttpServletRequest request) protected StringgetCallbackUrl(String serverURL) protected StringgetError(jakarta.servlet.http.HttpServletRequest request) getId()protected StringgetOrCreateServiceUser(jakarta.servlet.http.HttpServletRequest request, String accessToken) Retrieves or creates a service user.protected StringgetServiceUserId(String key) Returns the userId to use for token entries.protected OAuth2ServiceUserStorecom.google.api.client.auth.oauth2.CredentialhandleAuthorizationCallback(jakarta.servlet.http.HttpServletRequest request) Handles the authorization response and stores the token(s)booleanbooleancom.google.api.client.auth.oauth2.CredentialloadCredential(String user) Load a credential from the token store with the userId returned by getServiceUser() as key.voidsetAuthorizationServerURL(String authorizationServerURL) voidsetClientId(String clientId) voidsetClientSecret(String clientSecret) voidsetDescription(String description) voidsetEnabled(Boolean enabled) voidvoidvoidsetServiceName(String serviceName) voidsetTokenServerURL(String tokenServerURL) voidsetUserAuthorizationURL(String userAuthorizationURL)
-
Field Details
-
SCHEMA
- See Also:
-
HTTP_TRANSPORT
protected static final com.google.api.client.http.HttpTransport HTTP_TRANSPORTGlobal instance of the HTTP transport. -
JSON_FACTORY
protected static final com.google.api.client.json.JsonFactory JSON_FACTORYGlobal instance of the JSON factory. -
CODE_URL_PARAMETER
- See Also:
-
ERROR_URL_PARAMETER
- See Also:
-
serviceName
-
id
-
description
-
userAuthorizationURL
-
serviceUserStore
-
tokenStore
-
-
Constructor Details
-
NuxeoOAuth2ServiceProvider
public NuxeoOAuth2ServiceProvider()
-
-
Method Details
-
getAuthorizationUrl
Description copied from interface:OAuth2ServiceProviderReturns the authorization URL- Specified by:
getAuthorizationUrlin interfaceOAuth2ServiceProvider
-
getAuthorizationUrl
Description copied from interface:OAuth2ServiceProviderReturns the authorization URL- Specified by:
getAuthorizationUrlin interfaceOAuth2ServiceProvider
-
getCallbackUrl
-
getCallbackUrl
-
handleAuthorizationCallback
public com.google.api.client.auth.oauth2.Credential handleAuthorizationCallback(jakarta.servlet.http.HttpServletRequest request) Description copied from interface:OAuth2ServiceProviderHandles the authorization response and stores the token(s)- Specified by:
handleAuthorizationCallbackin interfaceOAuth2ServiceProvider
-
loadCredential
Load a credential from the token store with the userId returned by getServiceUser() as key.- Specified by:
loadCredentialin interfaceOAuth2ServiceProvider
-
getServiceUserId
Returns the userId to use for token entries. Should be overriden by subclasses wanting to rely on a different field as key. -
getOrCreateServiceUser
protected String getOrCreateServiceUser(jakarta.servlet.http.HttpServletRequest request, String accessToken) throws IOException Retrieves or creates a service user. Should be overriden by subclasses wanting to rely on a different field as key.- Throws:
IOException
-
getAuthorizationCodeFlow
public com.google.api.client.auth.oauth2.AuthorizationCodeFlow getAuthorizationCodeFlow() -
getServiceUserStore
-
getCredentialDataStore
-
getError
-
getAuthorizationCode
-
getServiceName
- Specified by:
getServiceNamein interfaceOAuth2ServiceProvider
-
getId
- Specified by:
getIdin interfaceOAuth2ServiceProvider
-
getDescription
- Specified by:
getDescriptionin interfaceOAuth2ServiceProvider
-
getTokenServerURL
- Specified by:
getTokenServerURLin interfaceOAuth2ServiceProvider
-
getUserAuthorizationURL
- Specified by:
getUserAuthorizationURLin interfaceOAuth2ServiceProvider
-
getClientId
- Specified by:
getClientIdin interfaceOAuth2ServiceProvider
-
getClientSecret
- Specified by:
getClientSecretin interfaceOAuth2ServiceProvider
-
getScopes
- Specified by:
getScopesin interfaceOAuth2ServiceProvider
-
getAuthorizationServerURL
- Specified by:
getAuthorizationServerURLin interfaceOAuth2ServiceProvider
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceOAuth2ServiceProvider
-
setEnabled
- Specified by:
setEnabledin interfaceOAuth2ServiceProvider
-
isProviderAvailable
public boolean isProviderAvailable()- Specified by:
isProviderAvailablein interfaceOAuth2ServiceProvider
-
setServiceName
- Specified by:
setServiceNamein interfaceOAuth2ServiceProvider
-
setId
- Specified by:
setIdin interfaceOAuth2ServiceProvider
-
setDescription
- Specified by:
setDescriptionin interfaceOAuth2ServiceProvider
-
setTokenServerURL
- Specified by:
setTokenServerURLin interfaceOAuth2ServiceProvider
-
setUserAuthorizationURL
- Specified by:
setUserAuthorizationURLin interfaceOAuth2ServiceProvider
-
setAuthorizationServerURL
- Specified by:
setAuthorizationServerURLin interfaceOAuth2ServiceProvider
-
setClientId
- Specified by:
setClientIdin interfaceOAuth2ServiceProvider
-
setClientSecret
- Specified by:
setClientSecretin interfaceOAuth2ServiceProvider
-
setScopes
- Specified by:
setScopesin interfaceOAuth2ServiceProvider
-