You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-js/features/connectivity/destination.mdx
+14-12Lines changed: 14 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -200,7 +200,7 @@ The SAP Cloud SDK provides a default implementation for the transformation of se
200
200
201
201
The default implementation also retrieves a service token, if needed.
202
202
203
-
Additionally, we provide a function to transform service bindings into OAuth2ClientCredentials destinations, assuming the service binding follows the structure outlined below:
203
+
Additionally, if the service binding follows the structure, we provide a transform function `transformServiceBindingToClientCredentialsDestination()` to transform the service binding to an `OAuth2ClientCredentials` destination.
204
204
205
205
```json
206
206
{
@@ -221,30 +221,33 @@ Additionally, we provide a function to transform service bindings into OAuth2Cli
221
221
}
222
222
````
223
223
224
-
If the service URL is not specified in the `url` property, it can alternatively be provided as part of the `options` parameter.
225
-
226
-
The following is a multi-tenant example, where the user's JWT is used for tenant-isolation in the cache together with a custom URL as target.
224
+
The following example shows how to retrieve an `OAuth2ClientCredentials` destination from a service binding with retrieved JWT from the incoming request, and a custom URL:
For other types of service bindings or if you want to overwrite the default behavior, provide a callback function (`serviceBindingTransformFn()`) in the request execution.
242
+
For a different service binding structure, write your own transform function of type `ServiceBindingTransformFunction`.
240
243
241
-
For example, if you have a binding for a custom service:
244
+
For example, if you have the following binding for a custom service:
242
245
243
246
```json
244
247
{
245
248
"VCAP_SERVICES": {
246
249
"custom-service": [
247
-
// This object is passed to `serviceBindingTransformFn()`
250
+
// This is the `service` object passed to `serviceBindingTransformFn()` function.
248
251
{
249
252
"name": "my-custom-service",
250
253
"label": "custom-service",
@@ -259,8 +262,7 @@ For example, if you have a binding for a custom service:
259
262
}
260
263
```
261
264
262
-
To transform this custom service binding you need to provide the `serviceBindingTransformFn()` function.
263
-
In the example below, we access the `service.credentials` to create a destination with authentiction type "BasicAuthentication".
265
+
You can write the following `serviceBindingTransformFn()` to create a destination with authentication type "BasicAuthentication".
0 commit comments