Class OAuth2ClientAuthTokenProviderService
java.lang.Object
com.flowable.core.spring.security.oauth2.client.OAuth2ClientAuthTokenProviderService
- All Implemented Interfaces:
com.flowable.platform.common.security.AuthTokenProvider
public class OAuth2ClientAuthTokenProviderService
extends Object
implements com.flowable.platform.common.security.AuthTokenProvider
Implementation of the
AuthTokenProvider
that uses the OAuth2AuthorizedClientService
to fetch an access
token for a clientRegistrationId.
Relies on the Spring security OAuth2 client registration machinery to lookup a client registration for a client registration id and to obtain access tokens.
- Author:
- Arthur Hupka-Merle
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AuthorizedClientServiceOAuth2AuthorizedClientManager
protected final ClientRegistrationRepository
-
Constructor Summary
ConstructorDescriptionOAuth2ClientAuthTokenProviderService
(ClientRegistrationRepository clientRegistrationRepository, OAuth2AuthorizedClientService authorizedClientService) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canProvideAuthToken
(String externalServiceId) com.flowable.platform.common.security.AuthToken
getAuthToken
(String externalServiceId) Obtain access token for a client registration id.
-
Field Details
-
authorizedClientManager
-
clientRegistrationRepository
-
-
Constructor Details
-
OAuth2ClientAuthTokenProviderService
public OAuth2ClientAuthTokenProviderService(ClientRegistrationRepository clientRegistrationRepository, OAuth2AuthorizedClientService authorizedClientService)
-
-
Method Details
-
getAuthToken
Obtain access token for a client registration id.- Specified by:
getAuthToken
in interfacecom.flowable.platform.common.security.AuthTokenProvider
- Parameters:
externalServiceId
- the client registration id to obtain the access token for- Returns:
- the JWT access token encoded as string.
-
canProvideAuthToken
- Specified by:
canProvideAuthToken
in interfacecom.flowable.platform.common.security.AuthTokenProvider
-