The type of the service or an instance of Service.
Optional
options: CachingOptions & { Options to influence caching behavior (see CachingOptions) and a JWT. By default, caching and usage of a circuit breaker are enabled.
Access token.
Copyright Ⓒ 2024 SAP SE or an SAP affiliate company. All rights reserved.
Returns an access token that can be used to call the given service. The token is fetched via a client credentials grant with the credentials of the given service. If multiple instances of the provided service exist, the first instance will be selected. When a JWT is passed, the tenant of the JWT will be used when performing the grant. When no JWT is passed, the grant will be performed using the provider tenant.
Throws an error if there is no instance of the given service type or the XSUAA service, or if the request to the XSUAA service fails.