Skip to content

Commit 377aa86

Browse files
committed
Change console code type to shell
1 parent dc0e5eb commit 377aa86

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

examples/custom-resources/oidc/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,29 +39,29 @@ kubectl config set-context --namespace default --current
3939
Create a secret with the TLS certificate and key that will be used for TLS termination of the web application and
4040
Keycloak:
4141
42-
```console
42+
```shell
4343
kubectl apply -f tls-secret.yaml
4444
```
4545

4646
## Step 2 - Deploy a Web Application
4747

4848
Create the application deployment and service:
4949

50-
```console
50+
```shell
5151
kubectl apply -f webapp.yaml
5252
```
5353

5454
## Step 3 - Deploy Keycloak
5555

5656
1. Create the Keycloak deployment and service:
5757

58-
```console
58+
```shell
5959
kubectl apply -f keycloak.yaml
6060
```
6161

6262
2. Create a VirtualServer resource for Keycloak:
6363

64-
```console
64+
```shell
6565
kubectl apply -f virtual-server-idp.yaml
6666
```
6767

@@ -73,7 +73,7 @@ To set up Keycloak:
7373
1. To connect to Keycloak, use `https://keycloak.example.com`.
7474
2. Make sure to save the client secret for NGINX-Plus client to the `SECRET` shell variable:
7575

76-
```console
76+
```shell
7777
SECRET=value
7878
```
7979

@@ -86,15 +86,15 @@ in a broken deployment.
8686
8787
1. Encode the secret, obtained in the previous step:
8888
89-
```console
89+
```shell
9090
echo -n $SECRET | base64
9191
```
9292
9393
2. Edit `client-secret.yaml`, replacing `<insert-secret-here>` with the encoded secret.
9494
9595
3. Create a secret with the name `oidc-secret` that will be used by the OIDC policy:
9696
97-
```console
97+
```shell
9898
kubectl apply -f client-secret.yaml
9999
```
100100
@@ -111,23 +111,23 @@ Steps:
111111
112112
1. Apply the ConfigMap `nginx-config.yaml`, which contains `zone-sync` configuration parameter that enable zone synchronization and the resolver using the kube-dns service.
113113
114-
```console
114+
```shell
115115
kubectl apply -f nginx-config.yaml
116116
```
117117
118118
## Step 7 - Deploy the OIDC Policy
119119
120120
Create a policy with the name `oidc-policy` that references the secret from the previous step:
121121
122-
```console
122+
```shell
123123
kubectl apply -f oidc.yaml
124124
```
125125
126126
## Step 8 - Configure Load Balancing
127127
128128
Create a VirtualServer resource for the web application:
129129
130-
```console
130+
```shell
131131
kubectl apply -f virtual-server.yaml
132132
```
133133

examples/custom-resources/oidc/keycloak_setup.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ Steps:
1717

1818
1. Save the address of Keycloak into a shell variable:
1919

20-
```console
20+
```shell
2121
KEYCLOAK_ADDRESS=keycloak.example.com
2222
```
2323

2424
2. Retrieve the access token and store it into a shell variable:
2525

26-
```console
26+
```shell
2727
TOKEN=`curl -sS -k --data "username=admin&password=admin&grant_type=password&client_id=admin-cli" "https://${KEYCLOAK_ADDRESS}/realms/master/protocol/openid-connect/token" | jq -r .access_token`
2828
```
2929

3030
Ensure the request was successful and the token is stored in the shell variable by running:
3131

32-
```console
32+
```shell
3333
echo $TOKEN
3434
```
3535

@@ -38,27 +38,27 @@ Steps:
3838

3939
3. Create the user `nginx-user`:
4040

41-
```console
41+
```shell
4242
curl -sS -k -X POST -d '{ "username": "nginx-user", "enabled": true, "credentials":[{"type": "password", "value": "test", "temporary": false}]}' -H "Content-Type:application/json" -H "Authorization: bearer ${TOKEN}" https://${KEYCLOAK_ADDRESS}/admin/realms/master/users
4343
```
4444

4545
4. Create the client `nginx-plus`:
4646

4747
1. If you are not using PKCE, use the following command to create an OIDC client that does not use PKCE:
4848

49-
```console
49+
```shell
5050
SECRET=`curl -sS -k -X POST -d '{ "clientId": "nginx-plus", "redirectUris": ["https://webapp.example.com:443/_codexch"], "attributes": {"post.logout.redirect.uris": "https://webapp.example.com:443/*"}}' -H "Content-Type:application/json" -H "Authorization: bearer ${TOKEN}" https://${KEYCLOAK_ADDRESS}/realms/master/clients-registrations/default | jq -r .secret`
5151
```
5252

5353
If everything went well, you should have the secret stored in $SECRET. To double-check, run:
5454

55-
```console
55+
```shell
5656
echo $SECRET
5757
```
5858

5959
2. Use the following command to create an OIDC client that uses PKCE:
6060

61-
```console
61+
```shell
6262
curl -sS -k -H "Content-Type: application/json" -H "Authorization: Bearer ${TOKEN}" \
6363
--data '{
6464
"clientId": "nginx-plus",

0 commit comments

Comments
 (0)