Class OAuth2ClientAuthTokenProviderService

java.lang.Object
com.flowable.core.spring.security.oauth2.client.OAuth2ClientAuthTokenProviderService
All Implemented Interfaces:
AuthTokenProvider

public class OAuth2ClientAuthTokenProviderService extends Object implements 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 Details

  • Constructor Details

  • Method Details

    • getAuthToken

      public AuthToken getAuthToken(String externalServiceId)
      Obtain access token for a client registration id.
      Specified by:
      getAuthToken in interface AuthTokenProvider
      Parameters:
      externalServiceId - the client registration id to obtain the access token for
      Returns:
      the JWT access token encoded as string.
    • canProvideAuthToken

      public boolean canProvideAuthToken(String externalServiceId)
      Description copied from interface: AuthTokenProvider
      Should return true, when the provider can provide an access token for the given externalServiceId.
      Specified by:
      canProvideAuthToken in interface AuthTokenProvider
      Parameters:
      externalServiceId - the external service id
      Returns:
      true, when the provider can provide an access token for the given service id