Class OauthProviderExtensionPoint
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.runtime.plugin.component.AbstractThreadSafeComponentExtensionPoint<OAuthProvider>
org.ametys.plugins.extrausermgt.oauth.OauthProviderExtensionPoint
- All Implemented Interfaces:
LogEnabled
,ExtensionPoint<OAuthProvider>
,Disposable
,Initializable
,Component
,Contextualizable
,Serviceable
,ThreadSafe
public class OauthProviderExtensionPoint
extends AbstractThreadSafeComponentExtensionPoint<OAuthProvider>
Extension point registering all the OAuth provider currently available
-
Field Summary
Fields inherited from class org.ametys.runtime.plugin.component.AbstractThreadSafeComponentExtensionPoint
_cocoonManager, _context, _manager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetProviderForState
(com.nimbusds.oauth2.sdk.id.State state) Get the provider linked to the state.Optional<com.nimbusds.oauth2.sdk.token.AccessToken>
getStoredAccessToken
(String providerId) Get the stored access token if it exist.Methods inherited from class org.ametys.runtime.plugin.component.AbstractThreadSafeComponentExtensionPoint
addComponent, addExtension, contextualize, dispose, getExtension, getExtensionsIds, hasExtension, initialize, initializeExtensions, service
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The avalon role
-
-
Constructor Details
-
OauthProviderExtensionPoint
public OauthProviderExtensionPoint()
-
-
Method Details
-
getStoredAccessToken
Get the stored access token if it exist. If a token exists, but is expired, this method will silently try to refresh it.- Parameters:
providerId
- the provider that granted the token- Returns:
- the access token or empty
-
getProviderForState
Get the provider linked to the state.- Parameters:
state
- the state linked to a provider- Returns:
- the provider id
- Throws:
IllegalStateException
- if the state is not linked to a provider
-