Enum Class DestinationServiceTokenExchangeStrategy

java.lang.Object
java.lang.Enum<DestinationServiceTokenExchangeStrategy>
com.sap.cloud.sdk.cloudplatform.connectivity.DestinationServiceTokenExchangeStrategy
All Implemented Interfaces:
Serializable, Comparable<DestinationServiceTokenExchangeStrategy>, Constable

public enum DestinationServiceTokenExchangeStrategy extends Enum<DestinationServiceTokenExchangeStrategy>
Enumeration which represents the strategies for performing a user token exchange, if necessary, upon retrieving a destination from the Destination service on BTP Cloud Foundry.
  • Enum Constant Details

    • FORWARD_USER_TOKEN

      public static final DestinationServiceTokenExchangeStrategy FORWARD_USER_TOKEN
      Default strategy of forwarding current user access token to the destination lookup.

      The BTP Destination Service supports the option to automatically manage token-exchange operations when necessary. This mode results in applications only invoking one outbound HTTP request per destination lookup, instead of two.

    • LOOKUP_THEN_EXCHANGE

      @Deprecated public static final DestinationServiceTokenExchangeStrategy LOOKUP_THEN_EXCHANGE
      Deprecated.
      since 5.0.1. Use FORWARD_USER_TOKEN instead.
      Legacy strategy of performing the user token exchange actively when necessary.

      When this strategy is used, the DestinationService first performs a "look up" of the destination by issuing a client credentials request to the destination service. The response then contains the destination, which is needed to determine the actual authentication type. Afterwards, depending on the authentication type, a user token exchange might be performed automatically.

    • LOOKUP_ONLY

      @Deprecated public static final DestinationServiceTokenExchangeStrategy LOOKUP_ONLY
      Deprecated.
      since 5.0.1. Use FORWARD_USER_TOKEN instead. If you just need the destination properties, use DestinationService.getDestinationProperties(String) instead.
      Legacy strategy to explicitly not perform a user token exchange.

      In the past, this approach was recommended for use cases where only the destination properties were required. Now, this has been superseded by DestinationService.getDestinationProperties(String).

      Caution: The retrieved destination might not be suitable to actually connect to the target system because the token exchange request is skipped when using this strategy, even if the destination demands an authentication type that is based on the user token exchange (such as AuthenticationType.OAUTH2_JWT_BEARER).

    • EXCHANGE_ONLY

      public static final DestinationServiceTokenExchangeStrategy EXCHANGE_ONLY
      Legacy strategy that can be used for destinations which require a user token for the authentication flow.

      Caution: This strategy is a performance loss and is subject to stricter rate-limits compared to FORWARD_USER_TOKEN. It should only be used in case the destination service responds with an error when FORWARD_USER_TOKEN is used.

  • Method Details

    • values

      public static DestinationServiceTokenExchangeStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DestinationServiceTokenExchangeStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Enum<DestinationServiceTokenExchangeStrategy>
    • getIdentifier

      @Nonnull public String getIdentifier()