Skip to content

Commit 8c61d06

Browse files
committed
avoid sentences running over code blocks
1 parent 8034555 commit 8c61d06

File tree

1 file changed

+42
-39
lines changed

1 file changed

+42
-39
lines changed

guides/security/authentication.md

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ As the mock user authentication is active, all (CAP) endpoints are [authenticate
117117
To simplify the development scenario, you can set <Config java>cds.security.authentication.mode = "model-relaxed"</Config> to deactivate authentication of endpoints derived from unrestricted CDS services.
118118
:::
119119

120-
Sending OData request `curl http://localhost:8080/odata/v4/CatalogService/Books --verbose`
121-
results in a `401` error response from the server indicating that the anonymous user has been rejected due to missing authentication.
120+
If you stay with the standard authentication mode, sending the OData request `curl http://localhost:8080/odata/v4/CatalogService/Books --verbose`
121+
results in a `401` error response from the server, indicating that the anonymous user has been rejected due to missing authentication.
122122
This is the case for all endpoints including the web application page at `/index.html`.
123123

124124
Mock users require **basic authentication**, hence sending the same request on behalf of mock user `admin` (password: `admin`) with `curl http://admin:admin@localhost:8080/odata/v4/CatalogService/Books` returns successfully (HTTP response `200`).
@@ -127,17 +127,17 @@ Mock users require **basic authentication**, hence sending the same request on b
127127

128128
<div class="impl node">
129129

130-
::: info
130+
::: tip
131131
In non-production profile, endpoints derived from unrestricted CDS services are not authenticated to simplify the development scenario.
132132
:::
133133

134-
Sending OData request
134+
Send an OData request through the restricted `AdminService` as follows:
135135

136136
```sh
137137
curl http://localhost:4004/odata/v4/admin/Books --verbose
138138
```
139139

140-
results in a `401` error response from the server indicating that the anonymous user has been rejected due to missing authentication.
140+
This results in a `401` error response from the server indicating that the anonymous user has been rejected due to missing authentication.
141141
This is true for all endpoints including the web application page at `/index.html`.
142142

143143
Mock users require **basic authentication**, hence sending the same request on behalf of mock user `alice` (no password) with
@@ -314,7 +314,7 @@ You can best configure and test IAS authentication in the Cloud, so let's enhanc
314314
315315
### Get Ready with IAS { #ias-ready }
316316
317-
Before working with IAS on CF, you need to
317+
Before working with IAS on CF, you need to do all of the following:
318318
319319
- Prepare an IAS (test) tenant. If not available yet, you need to [create](https://help.sap.com/docs/cloud-identity-services/cloud-identity-services/get-your-tenant) it now.
320320
@@ -324,14 +324,12 @@ towards your IAS tenant to use it as identity provider for applications in your
324324
- Ensure your development environment is [prepared for deploying](../deploy/to-cf#prerequisites) on CF,
325325
in particular you require a `cf` CLI session targeting a CF space in the test subaccount (test with `cf target`).
326326
327-
You can continue with the sample [already created](#mock-user-authentication). In the project root folder, execute
327+
You can continue with the sample [already created](#mock-user-authentication). In the project root folder, execute the following command to make your application ready for deployment to CF.
328328
329329
```sh
330330
cds add mta
331331
```
332332
333-
to make your application ready for deployment to CF.
334-
335333
<div class="impl java">
336334
337335
::: info
@@ -340,23 +338,23 @@ Command `add mta` will enhance the project with `cds-starter-cloudfoundry` and t
340338
341339
</div>
342340
343-
You also need to configure DB support:
341+
You also need to configure database support:
344342
345-
```sh [SAP HANA]
343+
```sh
346344
cds add hana
347345
```
348346
349347
350348
351349
### Adding IAS
352350
353-
Now the application is ready to be enhanced with IAS-support by executing
351+
Now the application is ready to be enhanced with IAS-support:
354352
355353
```sh
356354
cds add ias
357355
```
358356
359-
which automatically adds a service instance named `bookshop-ias` of type `identity` (plan: `application`) and binds the CAP application to it.
357+
This command automatically adds a service instance named `bookshop-ias` of type `identity` (plan: `application`) and binds the CAP application to it in the _mta.yaml_.
360358
361359
::: details Generated deployment descriptor for IAS instance and binding
362360
```yaml [mta.yaml]
@@ -404,16 +402,16 @@ Service instance and binding offer the following crucial configuration propertie
404402
| `app-identifier` | _binding_ | _Ensures stable subject in generated certificate (required for credential rotation)_ |
405403
406404
407-
[Lean more about IAS service instance and binding configuration](https://help.sap.com/docs/cloud-identity-services/cloud-identity-services/reference-information-for-identity-service-of-sap-btp){.learn-more}
405+
[Learn more about IAS service instance and binding configuration.](https://help.sap.com/docs/cloud-identity-services/cloud-identity-services/reference-information-for-identity-service-of-sap-btp){.learn-more}
408406
409407
<div id="learn-more-IAS-instances-bindings" />
410408
411-
Now let's pack and deploy the application with
409+
Now let's pack and deploy the application:
410+
412411
```sh
413412
cds up
414413
```
415414
416-
and wait until the application is up and running.
417415
You can test the status with `cf apps` on CLI level or in BTP Cockpit, alternatively.
418416
419417
The startup log should confirm the activated IAS authentication:
@@ -434,7 +432,7 @@ TODO
434432
435433
</div>
436434
437-
::: tip
435+
::: tip Local at this point?
438436
The local setup is still runnable on basis of mock users as there is no IAS binding in the environment.
439437
:::
440438
@@ -480,7 +478,7 @@ In BTP Cockpit, service instance `bookshop-ias` appears as a link that allows di
480478
481479
Due to CAP's autoconfiguration, all CAP endpoints are authenticated and expect valid OAuth tokens created for the IAS application.
482480
483-
Sending the test request
481+
The following request as anonymous user without a token results in a `401 Unauthorized`:
484482
485483
<div class="java">
486484
@@ -500,9 +498,7 @@ curl https://<org>-<space>-bookshop-srv.<landscape-domain> \
500498
501499
</div>
502500
503-
as anonymous user without a token results in a `401 Unauthorized` as expected.
504-
505-
Now let's fetch a token as basis for a fully authenticated test request.
501+
This is expected. Now let's fetch a token as basis for a fully authenticated test request.
506502
For doing so, you need to interact with IAS service which requires an authenticated client itself.
507503
508504
The overall setup with CLI client and the Cloud services is sketched in the diagram:
@@ -718,13 +714,21 @@ You can create a bookshop sample as described in [Mock User Authentication](#moc
718714
719715
Execute the following two commands in the project root folder, only if you haven't prepared your sample for IAS in the previous section already.
720716
721-
To make your application ready for deployment to CF:
717+
If there is no deployment descriptor yet, execute the following in the project root folder:
722718
723719
```sh
724720
cds add mta
725721
```
726722
727-
You also need to configure DB support:
723+
<div class="impl java">
724+
725+
::: tip
726+
Command `add mta` will enhance the project with `cds-starter-cloudfoundry` and therefore all [dependencies required for security](../../java/security#maven-dependencies) are added transitively.
727+
:::
728+
729+
</div>
730+
731+
You also need to configure database support:
728732
729733
```sh [SAP HANA]
730734
cds add hana
@@ -877,7 +881,7 @@ If you modify the _xs-security.json_ manually, make sure that the scope names in
877881
878882
#### Start and Check the Deployment
879883
880-
Now let's pack and deploy the application with
884+
Now let's pack and deploy the application:
881885
882886
<div class="impl node">
883887
@@ -928,7 +932,7 @@ The local setup is still runnable on basis of mock users as there is no IAS bind
928932
929933
Due to CAP's autoconfiguration, all CAP endpoints are [authenticated automatically](#model-auth) and expect valid XSUAA tokens.
930934
931-
Sending the test request
935+
The following request as anonymous user without a token results in a `401 Unauthorized`:
932936
933937
<div class="java">
934938
@@ -948,24 +952,22 @@ curl https://<org>-<space>-bookshop-srv.<landscape-domain> \
948952
949953
</div>
950954
951-
as anonymous user without a token the request results in a `401 Unauthorized` as expected.
952-
953-
Now let's fetch an XSUAA token to prepare an authenticated test request.
954-
To do so, you need to interact with XSUAA service which requires a valid authentication as well.
955+
This is expected. Now let's fetch an XSUAA token to prepare an authenticated test request.
956+
Here, you need to interact with XSUAA service which requires a valid authentication as well.
955957
956-
As first step add a new client for XSUAA by creating an appropriate service key with
958+
As first step add a new client for XSUAA by creating an appropriate service key:
957959
958960
```sh
959961
cf create-service-key bookshop-auth bookshop-auth-key
960962
```
961963
962-
You can inspect the service key credentials by executing
964+
You can inspect the service key credentials as follows:
963965
964966
```sh
965967
cf service-key bookshop-auth bookshop-auth-key
966968
```
967969
968-
which prints the information to the console:
970+
This command prints the information to the console:
969971
970972
```json
971973
{
@@ -1141,22 +1143,23 @@ The same is true for the logout flow.
11411143
:::
11421144
11431145
1144-
Now update the Cloud deployment with
1146+
Now update the Cloud deployment:
11451147
11461148
```sh
11471149
cds up
11481150
```
11491151
1150-
and verify it by running `cf apps` in the targeted space:
1152+
Verify it by running `cf apps` in the targeted space:
11511153
11521154
```sh
1153-
name requested state processes routes
1154-
bookshop-potal started web:1/1 <org>-<space>-bookshop.<landscape-domain>
1155-
bookshop-potal-db-deployer stopped web:0/1
1156-
bookshop-potal-srv started web:1/1 <org>-<space>-bookshop-srv.<landscape-domain>
1155+
> $ cf apps
1156+
name requested state processes routes
1157+
bookshop-portal started web:1/1 <org>-<space>-bookshop.<landscape-domain>
1158+
bookshop-portal-db-deployer stopped web:0/1
1159+
bookshop-portal-srv started web:1/1 <org>-<space>-bookshop-srv.<landscape-domain>
11571160
```
11581161
1159-
and open the route exposed by the `bookshop` UI application in a new browser session.
1162+
Open the route exposed by the `bookshop` UI application in a new browser session.
11601163
11611164
11621165

0 commit comments

Comments
 (0)