Skip to content

Commit c3ed5d6

Browse files
committed
2 parents 6ee8ec9 + 040e3f3 commit c3ed5d6

File tree

3 files changed

+40
-22
lines changed

3 files changed

+40
-22
lines changed

.gitleaksignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/github/workspace/README.md:generic-api-key:58
2+
/github/workspace/README.md:generic-api-key:81
23
/github/workspace/README.md:jwt:81
4+
/github/workspace/README.md:generic-api-key:82
35
/github/workspace/README.md:jwt:82
46
/github/workspace/openid-connect-provider-debugger/docker-compose.test.yml:generic-api-key:14
57
/github/workspace/openid-connect-provider-debugger/docker-compose.test.yml:generic-api-key:15

README.md

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ should accept (<http://localhost:8080/login> in our example below).
2929
### Using the web UI
3030

3131
Once your have provided and gathered the above information, run the
32-
following docker:
32+
following Docker command:
3333

3434
```bash
35-
docker run -i -p 8080:80 leplusorg/openid-connect-provider-debugger
35+
docker run -i -p 127.0.0.1:8080:80 leplusorg/openid-connect-provider-debugger
3636
```
3737

3838
Finally, open <http://localhost:8080> in your favorite browser and
@@ -43,7 +43,7 @@ flow. Remember that if you are already signed in, you may go through
4343
the authentication without any prompt. If you authenticate
4444
successfully, you should see a JSON document containing all the
4545
information received by the debugger from the OP. You can find more
46-
details (including the raw tokens) in the logs printed by the docker
46+
details (including the raw tokens) in the logs printed by the Docker
4747
container.
4848

4949
A successful sign in would result in the display of a JSON document like this one:
@@ -78,8 +78,8 @@ A successful sign in would result in the display of a JSON document like this on
7878
"preferred_username": "tom",
7979
"sub": "38b4a290-5332-4c4c-bb8f-46eb2826c7ea"
8080
},
81-
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJwbjdtd1B1WDZ5ZjBvSHEtTDFiZ2l6T2FVeGs5aDlGaU8ycjlMcV9LYkNRIn0.eyJleHAiOjE1OTA2MTk3NzQsImlhdCI6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
8585

@@ -98,11 +98,11 @@ reserved characters ('&', '?', '/' etc.).
9898

9999
### Using environment variables
100100

101-
You can pass the parameters to the docker container using environment
101+
You can pass the parameters to the Docker container using environment
102102
variales like this:
103103

104104
```bash
105-
docker run -i -e 'oidc_client_id=id' -e 'oidc_client_secret=secret' -e 'oidc_discovery=http://192.168.0.1:8081/realms/master/.well-known/openid-configuration' -e 'oidc_redirect_uri=http://localhost:8080/login' -p 8080:80 leplusorg/openid-connect-provider-debugger
105+
docker run -i -e 'oidc_client_id=id' -e 'oidc_client_secret=secret' -e 'oidc_discovery=http://192.168.0.1:8081/realms/master/.well-known/openid-configuration' -e 'oidc_redirect_uri=http://localhost:8080/login' -p 127.0.0.1:8080:80 leplusorg/openid-connect-provider-debugger
106106
```
107107

108108
See section "Parameters" below for a description of each parameter.
@@ -112,7 +112,7 @@ the authentication flow.
112112

113113
## Parameters
114114

115-
Settings are passed to the docker image using environment variables
115+
Settings are passed to the Docker image using environment variables
116116
(e.g. using the -e command-line option) or directly to NGINX using URL
117117
parameters.
118118

@@ -127,7 +127,7 @@ Default: none
127127
### oidc_client_secret
128128

129129
Description: the OpenID Connect Client Secret (WARNING: this sensitive
130-
value will appear in the logs of the docker so please do not share
130+
value will appear in the logs of the Docker so please do not share
131131
your logs without redacting this value).
132132

133133
Mandatory: yes
@@ -207,7 +207,7 @@ Note: `/debug`, `/login` and `/logout` share all the same code. `/debug`
207207
and `/login` behave absolutely identical, while `/logout` behaves
208208
differently because of the used OIDC lua library.
209209

210-
## Test
210+
## Testing
211211

212212
To test the debugger (or any other Relying Party), you can use JBoss
213213
Keycloak as a local OpenID Connect Provider.
@@ -216,15 +216,29 @@ Launch Keycloak using the following command (choosing the desired
216216
username and password):
217217

218218
```bash
219-
docker run -i -e 'KEYCLOAK_ADMIN=admin' -e 'KEYCLOAK_ADMIN_PASSWORD=admin' -p 8081:8080 quay.io/keycloak/keycloak:latest start-dev
219+
docker run -i -e 'KC_BOOTSTRAP_ADMIN_USERNAME=admin' -e 'KC_BOOTSTRAP_ADMIN_PASSWORD=admin' -p 0.0.0.0:8081:8080 quay.io/keycloak/keycloak:latest start-dev
220220
```
221221

222-
Then go to the Keycloak admin console at
222+
Here we use the IP address `0.0.0.0` to expose Keycloak on both
223+
`localhost` (`127.0.0.0.1`) and on your machine's public IP because we
224+
will need to use that public IP to access it from the
225+
openid-connect-provider-debugger Docker instance. We cannot use
226+
`localhost` because it would be interpreted by the
227+
openid-connect-provider-debugger instance as referring to itself
228+
instead of the `localhost` of the host where Keycloak's port is
229+
mapped. **If your host is running a firewall (as it should), this means
230+
that you probably need to allow incoming connections to Keycloak's
231+
port (`8081` in our example) on your public IP.** Ideally your
232+
firewall should let you allow only connection from and to the same
233+
public IP so that you don't expose Keycloak to your whole local
234+
network.
235+
236+
Next go to the Keycloak's admin console at
223237
<http://localhost:8081/admin/master/console/#/master/clients>
224238
and authenticate using the username and password chosen in the above
225239
command.
226240

227-
Click the "Create" button to create a new client. Choose a client ID
241+
Click the "Create client" button to create a new client. Choose a client ID
228242
and click "Next". On the next screen, toggle on the Client
229243
authentication then click Next again. Then on the
230244
final screen you need to provide the "Valid Redirect URIs". Put here
@@ -237,10 +251,10 @@ details). The client ID is the value that you just chose when creating
237251
the client in Keycloak. The client secret is the value that you copied
238252
from the Credentials tab. The OpenID Connect Discovery URL will be
239253
<http://192.168.0.1:8081/realms/master/.well-known/openid-configuration>
240-
where you need to replace the IP address by your local machine network
241-
address. You need to use an IP address that works from inside the
242-
debugger docker container (for the debugger to be able to connect to
243-
the OP to get the discovery metadata and later retrieve the
254+
where you need to replace the IP address `192.168.0.1` by your local
255+
machine network address. You need to use an IP address that works from
256+
inside the debugger Docker container (for the debugger to be able to
257+
connect to the OP to get the discovery metadata and later retrieve the
244258
tokens). This is why you can't use `localhost` or `127.0.0.1` which
245259
the debugger would interpret as itself instead of the provider.
246260

@@ -296,11 +310,13 @@ Connect implementation comes from
296310

297311
If all you need is to do a simple test and you do not need to see the
298312
details of each HTTP request and response, you can use this online
299-
OIDC debugger: <https://oidcdebugger.com>. Its source code is available
300-
at <https://github.com/nbarbettini/oidc-debugger>.
313+
[OIDC debugger](https://oidcdebugger.com) with the corresponding
314+
[source code](https://github.com/nbarbettini/oidc-debugger).
315+
316+
Auth0 also provides a web-hosted [OpenID Connect Playground](https://openidconnect.net).
301317

302318
Another alternative is the official OpenID Foundation certification
303319
tests that can be run online at
304320
<https://op.certification.openid.net:60000> and
305-
<https://rp.certification.openid.net:8080>, the source code being
306-
available at <https://github.com/openid-certification/oidctest>.
321+
<https://rp.certification.openid.net:8080>, with the corresponding
322+
[source code](https://github.com/openid-certification/oidctest).

openid-connect-provider-debugger/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# checkov:skip=CKV_DOCKER_3
2-
FROM openresty/openresty:1.25.3.2-alpine-fat@sha256:aa8ea52fa35a296558aed8b392fb39d575e39dd4a7717fa44f1fd6fc09c1185d
2+
FROM openresty/openresty:1.27.1.1-alpine-fat@sha256:aa8ea52fa35a296558aed8b392fb39d575e39dd4a7717fa44f1fd6fc09c1185d
33

44
ARG LUA_RESTY_OPENIDC_VERSION="1.7.6"
55

0 commit comments

Comments
 (0)