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-java/features/connectivity/003-service-bindings.mdx
+61-24Lines changed: 61 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,25 @@ This is an example where the service offers multiple API endpoints and you need
52
52
53
53
Explore the [BtpServiceOptions](pathname:///java-api/v5/com/sap/cloud/sdk/cloudplatform/connectivity/BtpServiceOptions.html) class to find the options relevant for your service and your use-case.
54
54
55
+
### Supported Credential Types
56
+
57
+
The SAP Cloud SDK supports various credential types for XSUAA- and IAS-based services:
58
+
59
+
- Client secret (`instance-secret`, `binding-secret` (XSUAA) or `binding-secret` (IAS))
60
+
- Client certificate
61
+
- Certificate generated by the platform, present in the binding (`x509` (XSUAA) or `X509_GENERATED` (IAS))
62
+
- Certificate attested by the Zero Trust Identity Service (ZTIS) (`x509_attested` (XSUAA) or `X509_ATTESTED` (IAS))
63
+
64
+
If the service binding contains no explicit credential type, the SAP Cloud SDK defaults to using a client secret.
65
+
The credential type `X509_PROVIDED` (IAS), as well as `x509` with a custom provided certificate (XSUAA), are currently not supported.
66
+
67
+
:::info ZTIS Integration
68
+
69
+
To use the `X509_ATTESTED` or `x509_attested` credential type, additional setup is required.
70
+
Read more about how to configure your app for this credential type on the documentation for [using certificates from the Zero Trust Identity Service (ZTIS)](/docs/java/features/connectivity/mtls#using-automated-certificate-rotation-using-the-zero-trust-identity-service-sap-internal).
71
+
72
+
:::
73
+
55
74
### List of Supported Services
56
75
57
76
The SAP Cloud SDK supports a variety of services out of the box.
For IAS-based applications and services, principal propagation the grant type `jwt-bearer` needs to be enabled.
156
+
This can be enabled in the IAS admin console, or by setting the `grant-types` parameter on the identity service instance.
157
+
Refer to the documentation [here](https://help.sap.com/docs/cloud-identity-services/cloud-identity-services/reference-information-for-identity-service-of-sap-btp?version=Cloud).
158
+
159
+
:::
160
+
134
161
## Using the Extended Service for User and Account Authentication (XSUAA)
135
162
136
163
Communicating with SAP provided services secured by the SAP XSUAA service usually requires explicit support by the SAP Cloud SDK (see [list of supported services](#list-of-supported-services)).
@@ -154,35 +181,11 @@ The code above instructs the SAP Cloud SDK to
154
181
This configuration results in a destination that uses the XSUAA instance of your application to authenticate against, but communicates with the system reachable under the provided URI.
155
182
Without the option specified in line 3, the destination would target the XSUAA instance itself.
156
183
157
-
:::note Principal Propagation with IAS
158
-
159
-
For IAS-based applications and services principal propagation requires additional configuration.
160
-
When creating the IAS service binding an additional parameter needs to be passed to enable the `jwt-bearer` grant type.
161
-
Refer to the documentation [here](https://github.wdf.sap.corp/CPSecurity/Knowledge-Base/blob/master/08_Tutorials/iasbroker/README.md#parameters) (SAP-internal).
162
-
163
-
:::
164
-
165
184
## Using the Identity and Authentication Service (IAS)
166
185
167
-
:::warning Beta API
168
-
169
-
The API for connecting to services secured by the SAP Identity and Authentication Service (IAS) is currently in beta and subject to change.
170
-
171
-
:::
172
-
173
186
In case your application is bound to an instance of the SAP Identity and Authentication Service (IAS) you can use the SAP Cloud SDK to connect to other applications and services that are secured using IAS.
174
187
Effectively, the SAP Cloud SDK implements the OAuth flows described [here](https://help.sap.com/docs/identity-authentication/identity-authentication/consume-apis-from-other-applications).
175
188
176
-
:::info Supported Credential Types
177
-
178
-
The SAP Cloud SDK supports the credential types `binding-secret`, `X509_GENERATED` and `X509_ATTESTED` for IAS service bindings.
179
-
180
-
If you want to use the `X509_ATTESTED` credential type, you need to add the `connectivity-ztis` dependency to your project.
181
-
Read more about how to configure your app for this credential type on the documentation for [using certificates from the Zero Trust Identity Service (ZTIS)](/docs/java/features/connectivity/mtls#using-automated-certificate-rotation-using-the-zero-trust-identity-service-sap-internal).
182
-
183
-
The type `X509_PROVIDED` is currently not supported.
184
-
:::
185
-
186
189
### Connecting to Services
187
190
188
191
If your service is secured using IAS and is using the dedicated [service binding format](#service-binding-format) supported by the SAP Cloud SDK, you can obtain a destination by passing the service label as the `ServiceIdentifier`:
@@ -236,6 +239,40 @@ var options = ServiceBindingDestinationOptions
236
239
.build();
237
240
```
238
241
242
+
In case the application URL, dependency name or other properties are dynamic or tenant-specific, you may want to use a SAP BTP destination to hold this information.
243
+
Check the example below for how to combine SAP BTP destinations with an IAS App2App flow.
244
+
245
+
<details>
246
+
<summary>Example for an IAS-based App2App Flow using SAP BTP Destinations</summary>
247
+
248
+
Define a destination in SAP BTP cockpit and set the target system URL, a property to hold the App2App dependency name, as well as any further properties you might need for your use case (e.g. additional headers, query parameters, etc.).
var destination =ServiceBindingDestinationLoader.defaultLoaderChain().getDestination(opts);
270
+
```
271
+
272
+
Effectively, the destination from SAP BTP destination service serves as a config map and has to be merged with the destination created locally for the App2App flow.
273
+
274
+
</details>
275
+
239
276
### Calling Back Applications
240
277
241
278
If you received an incoming request from an application using IAS you can use the following options to create a destination for calling back the application:
Copy file name to clipboardExpand all lines: docs-java/features/connectivity/007-mtls.mdx
+29-14Lines changed: 29 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,11 +166,14 @@ This guide covers how you can configure and use the SAP Cloud SDK to use certifi
166
166
167
167
The following prerequisites are required to use ZTIS:
168
168
169
-
- You are deploying an application on Cloud Foundry
170
-
- You have assigned the required entitlement for using ZTIS to your subaccount
171
-
- You have created a service instance of `zero-trust-identity` in your Cloud Foundry space
172
-
- You have bound the ZTIS service instance to your application
173
-
- You have added the `zero_trust_sidecar_buildpack` as an additional buildpack for your application
169
+
- You have assigned the required entitlement for using ZTIS to your subaccount.
170
+
- You have created a service instance of `zero-trust-identity`.
171
+
- You have bound the ZTIS service instance to your application.
172
+
- For Cloud Foundry: You have added the `zero_trust_sidecar_buildpack` as an additional buildpack for your application.
173
+
- For Kubernetes (Kyma, Gardener):
174
+
- You have installed the [ZTIS Operator](https://github.tools.sap/pse/ztis-operator?tab=readme-ov-file) in your cluster.
175
+
- On Kyma, this is available as the [ZTIS Agent Kyma Module](https://pages.github.tools.sap/pse/pse-docs/docs/identity-k8s/references/ztis-agent-kyma-module).
176
+
- Your application has the [`SPIFFE_ENDPOINT_SOCKET` environment variable](https://github.com/spiffe/spiffe/blob/main/standards/SPIFFE_Workload_Endpoint.md#4-locating-the-endpoint) set, pointing to the workload attestation API of the ZTIS agent.
174
177
175
178
Head over to the [official documentation](https://pages.github.tools.sap/pse/pse-docs/docs/identity/), the [reference manual](https://github.tools.sap/pse/blueprints/blob/main/examples/cf/ZTIS_Reference.md) and [sample code](https://github.tools.sap/pse/blueprints/tree/main/examples/cf/java/ztis-identity/cf-manifest) to learn more about how to use ZTIS.
176
179
@@ -185,26 +188,38 @@ To enable support by SAP Cloud SDK for certificates provided by ZTIS in your app
185
188
</dependency>
186
189
```
187
190
188
-
With this dependency you can create a new or modify an existing `HttpDestination` to use the certificate provided by ZTIS.
191
+
### Integration with SAP BTP Services
192
+
193
+
The SAP Cloud SDK supports using certificates provided by ZTIS to authenticate to SAP BTP services.
194
+
For example:
195
+
196
+
- Identity Authentication Service (IAS)
197
+
- Authorization and Trust Management Service (XSUAA)
198
+
- Destination Service, Connectivity Service, etc.
199
+
200
+
The SAP Cloud SDK automatically recognizes the credential type `X509_ATTESTED` and uses the certificates provided by ZTIS in that case.
201
+
Consequently, any SAP BTP service supporting this credential type can be accessed using ZTIS.
202
+
For more details please refer to the documentation on [connecting to services](/docs/java/features/connectivity/service-bindings).
203
+
204
+
### Connecting to other Systems using Destinations
205
+
206
+
Aside from connecting to SAP BTP services, you can also obtain or enhance any `HttpDestination` to use the certificate provided by ZTIS.
189
207
190
208
```java
191
209
var ks =ZeroTrustIdentityService.getInstance().getOrCreateKeyStore();
192
210
211
+
// create a new destination
193
212
var newDestination =DefaultHttpDestination.builder("https://foo.com")
194
213
.keyStore(ks)
195
214
.build();
196
-
var enhancedDestination =DefaultHttpDestination.fromDestination(DestinationAccessor.getDestination("myDestination"))
215
+
216
+
// enhance an existing destination, e.g. from BTP destination service
217
+
var existingDestination =DestinationAccessor.getDestination("myDestination");
218
+
var enhancedDestination =DefaultHttpDestination.fromDestination(existingDestination)
197
219
.keyStore(ks)
198
220
.build();
199
221
```
200
222
201
-
### Integration with Identity Authentication Service (IAS)
202
-
203
-
The SAP Cloud SDK also supports using certificates provided by ZTIS to authenticate to the Identity Authentication Service (IAS).
204
-
205
-
This works fully out of the box if you have an instance of IAS with the corresponding credential type `X509_ATTESTED` configured.
206
-
For more details please refer to the documentation on [connecting to services](/docs/java/features/connectivity/service-bindings).
207
-
208
223
### Developing Locally
209
224
210
225
On Cloud Foundry the `zero_trust_sidecar_buildpack` adds a sidecar to your application that fetches the certificates from ZTIS.
0 commit comments