Class OAuth2Options

java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.OAuth2Options

public final class OAuth2Options extends Object
Represents various configuration parameters for the OAuth2 destination creation.
Since:
5.5.0
  • Field Details

    • DEFAULT_TIMEOUT

      public static final ResilienceConfiguration.TimeLimiterConfiguration DEFAULT_TIMEOUT
      The default timeout of 10 seconds for token retrieval.
      Since:
      5.12.0
    • DEFAULT_TOKEN_CACHE_PARAMETERS

      public static final OAuth2Options.TokenCacheParameters DEFAULT_TOKEN_CACHE_PARAMETERS
      Default token cache configuration used by OAuth2Service. Effective defaults: 1 hour duration, 1000 entries, 30 seconds delta and cache statistics disabled.
      Since:
      5.21.0
      See Also:
      • TokenCacheConfiguration.DEFAULT
    • DEFAULT

      public static final OAuth2Options DEFAULT
      The default OAuth2Options instance that does not alter the token retrieval process and does not use mTLS for the target system connection.
  • Method Details

    • skipTokenRetrieval

      public boolean skipTokenRetrieval()
      Indicates whether to skip the OAuth2 token flow.
      Returns:
      true if the token retrieval should be skipped, false otherwise.
    • getAdditionalTokenRetrievalParameters

      @Nonnull public Map<String,String> getAdditionalTokenRetrievalParameters()
      Returns additional parameters for the OAuth2 token flow. These parameters will be put into the URL-form-encoded body in addition to the regular authentication information (such as the clientid).
      Returns:
      Additional parameters for the OAuth2 token request.
    • builder

      @Nonnull public static OAuth2Options.Builder builder()
      Returns a new OAuth2Options.Builder instance that can be used to create a customized OAuth2Options instance.
      Returns:
      A new OAuth2Options.Builder.
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getTimeLimiter

      @Nonnull public ResilienceConfiguration.TimeLimiterConfiguration getTimeLimiter()
      A timeout to be applied for token retrieval.
      Since:
      5.12.0
    • getClientKeyStore

      @Nullable public KeyStore getClientKeyStore()
      The KeyStore to use for building an mTLS connection towards the target system. This KeyStore is not used to build an mTLS connection towards the OAuth2 token service.
    • getTokenCacheParameters

      @Nonnull public OAuth2Options.TokenCacheParameters getTokenCacheParameters()
      Configuration for caching OAuth2 tokens.
      Since:
      5.21.0