Declaration of a destination to be retrieved from an environment variable or from the destination service on SAP Business Technology Platform, including all DestinationOptions.

Use an object of this interface to specify which destination shall be used when executing a request. The destination will be retrieved via its DestinationFetchOptions.destinationName according to the following algorithm:

  1. If a destination of this DestinationFetchOptions.destinationName is defined in the environment variable destinations (if available), it will be converted into a Destination and used for the request.
  2. Otherwise, the destination service on SAP Business Technology Platform is queried for a destination with the given DestinationFetchOptions.destinationName, using the access token provided as value of property jwt. Additionally, you can set DestinationOptions for objects of this interface. For more information check out our documentation: https://sap.github.io/cloud-sdk/docs/js/features/connectivity/destination.
interface DestinationFetchOptions {
    cacheVerificationKeys?: boolean;
    destinationName: string;
    iasToXsuaaTokenExchange?: boolean;
    isolationStrategy?: IsolationStrategy;
    iss?: string;
    jwt?: string;
    refreshToken?: string;
    retry?: boolean;
    selectionStrategy?: DestinationSelectionStrategy;
    useCache?: boolean;
}

Hierarchy (View Summary)

Properties

cacheVerificationKeys?: boolean

The verification keys are cached if set to true.

destinationName: string

Name of the destination to retrieve, mandatory.

iasToXsuaaTokenExchange?: boolean

Option to enable/disable the IAS token to XSUAA token exchange.

isolationStrategy?: IsolationStrategy

The isolation strategy used for caching destinations. For the available options, see IsolationStrategy. By default, 'tenant-user' is set.

iss?: string

This property is only considered in case no jwt is provided. It is meant for situations where you do not have a token e.g. background processes. The value for iss is the issuer field of a JWT e.g. https://.localhost:8080/uaa/oauth/token.

ATTENTION: If this property is used, no validation of the provided subdomain value is done. This is differs from how the jwt is handled. So be careful that the used value is not manipulated and breaks the tenant isolation of your application.

jwt?: string

The user token of the current request.

ATTENTION: The property is mandatory in the following cases:

  • User-dependent authentication flow is used, e.g., OAuth2UserTokenExchange, OAuth2JWTBearer, OAuth2SAMLBearerAssertion, SAMLAssertion or PrincipalPropagation.
  • Multi-tenant scenarios with destinations maintained in the subscriber account. This case is implied if the selectionStrategy is set to alwaysSubscriber.
refreshToken?: string

The token is used to request an access token from an OAuth server. The value is mandatory for authentication type OAuth2RefreshToken and is ignored for other authentication types. The value must be provided in a refresh token format.

retry?: boolean

The call to destination/{name} sometimes also performs a token exchange. Such calls can be flaky due to an unstable token exchange endpoint. This parameter enables 3 retries on the destination by name calls. By default, the retry is disabled.

selectionStrategy?: DestinationSelectionStrategy

Method that implements the selection strategy of the retrieved destination. Uses subscriberFirst per default. Use the selector helper DestinationSelectionStrategies to select the appropriate selection strategy.

useCache?: boolean

A boolean value that indicates whether to read destinations from cache.

Copyright Ⓒ 2024 SAP SE or an SAP affiliate company. All rights reserved.