Skip to content

Commit e934729

Browse files
committed
Cleaned up local OIDC setup
1 parent 9b646ff commit e934729

4 files changed

Lines changed: 12 additions & 33 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
88

9+
* [PR-591](https://github.com/itk-dev/deltag.aarhus.dk/pull/591)
10+
Cleaned up local OIDC setup
911
* [PR-587](https://github.com/itk-dev/deltag.aarhus.dk/pull/587)
1012
Cleaned up translations
1113
* [PR-586](https://github.com/itk-dev/hoeringsportal/pull/586)

docker-compose.oidc.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,17 @@ services:
22
# https://github.com/geigerzaehler/oidc-provider-mock
33
idp-citizen:
44
image: ghcr.io/geigerzaehler/oidc-provider-mock:latest
5-
profiles:
6-
- oidc
7-
- test
85
# Let this container be accessible both internally and externally on the same domain.
96
container_name: idp-citizen.${COMPOSE_DOMAIN}
107
networks:
118
- app
129
- frontend
13-
ports:
14-
- "80"
1510
labels:
1611
- "traefik.enable=true"
1712
- "traefik.docker.network=frontend"
1813
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-idp.rule=Host(`idp-citizen.${COMPOSE_DOMAIN}`)"
1914
command:
2015
[
21-
"--port",
22-
"80",
2316
"--user-claims",
2417
'{"sub": "citizen1", "dk_ssn": "1111111111", "name": "Anders And", "zip": "1111"}',
2518
"--user-claims",
@@ -34,27 +27,19 @@ services:
3427
'{"sub": "aarhusianer", "dk_ssn": "2611740000", "name": "Betina Henningsentest"}',
3528
]
3629

37-
# https://github.com/Soluto/oidc-server-mock
3830
idp-employee:
3931
image: ghcr.io/geigerzaehler/oidc-provider-mock:latest
40-
profiles:
41-
- oidc
42-
- test
4332
# Let this container be accessible both internally and externally on the same domain.
4433
container_name: idp-employee.${COMPOSE_DOMAIN}
4534
networks:
4635
- app
4736
- frontend
48-
ports:
49-
- "80"
5037
labels:
5138
- "traefik.enable=true"
5239
- "traefik.docker.network=frontend"
5340
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}_idp-employee.rule=Host(`idp-employee.${COMPOSE_DOMAIN}`)"
5441
command:
5542
[
56-
"--port",
57-
"80",
5843
"--user-claims",
5944
'{"sub": "user", "email": "user@example.com", "groups": ["authenticated"]}',
6045
"--user-claims",
@@ -78,7 +63,7 @@ services:
7863
idp_mock_api:
7964
image: dotronglong/faker:stable
8065
profiles:
81-
- oidc
66+
- oidc-api
8267
networks:
8368
- app
8469
- frontend

documentation/localDevelopment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ Start docker
111111
```sh
112112
docker compose pull
113113
docker compose up --detach
114-
# Note: If you want to start pretix and the mock OIDC IdP you have to enable the "pretix" and "oidc" profiles (cf. https://docs.docker.com/compose/profiles/):
115-
# docker compose --profile pretix --profile oidc up --detach
114+
# Note: If you want to start pretix you have to enable the "pretix" profile (cf. https://docs.docker.com/compose/profiles/):
115+
# docker compose --profile pretix up --detach
116116
docker compose exec phpfpm composer install
117117
docker compose exec phpfpm vendor/bin/drush --yes site:install --existing-config
118118

documentation/openIdConnect.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ docker compose exec phpfpm vendor/bin/drush config:get --include-overridden open
3434
See the [Høringsportalen OpenID Connect module](../web/modules/custom/hoeringsportal_openid_connect/README.md) for
3535
details on configuring OpenID Connect authentification for citizens.
3636

37-
For local testing we use [OpenId Connect Server Mock](https://github.com/Soluto/oidc-server-mock) for (almost) real
37+
For local testing we use [OpenID Provider Mock](https://github.com/geigerzaehler/oidc-provider-mock) for (almost) real
3838
OpenID Connect. Users and their claims are defined in
39-
[`docker-compose.override.yml`](../../../../docker-compose.override.yml).
39+
[`docker-compose.oidc.yml`](../../../../docker-compose.oidc.yml).
4040

4141
## Employee authentification
4242

@@ -56,24 +56,16 @@ docker compose exec phpfpm vendor/bin/drush php:eval "\Drupal\taxonomy\Entity\Te
5656
## Debugging OpenID Connect authentification
5757

5858
```sh
59-
docker compose --profile oidc up --detach
59+
docker compose up --detach
6060
```
6161

6262
### Local OIDC test
6363

64-
During (local) development we use [OpenId Connect Server Mock](https://github.com/Soluto/oidc-server-mock) (cf.
64+
During (local) development we use [OpenID Provider Mock](https://github.com/geigerzaehler/oidc-provider-mock) (cf.
6565
[`docker-compose.oidc.yml`](docker-compose.oidc.yml) which is
6666
[included](https://docs.docker.com/compose/how-tos/multiple-compose-files/include/) in
6767
[`docker-compose.override.yml`](docker-compose.override.yml)).
6868

69-
#### Employees
70-
71-
| Username | Password | Groups |
72-
|---------------------|----------------------|---------------|
73-
| department1-admin | department1-admin | administrator |
74-
| department2-editor | department2-editor | editor |
75-
| department3-editor | department3-editor | editor |
76-
7769
## Debug OIDC
7870

7971
During development it can be useful to see the user info we actually get during OpenID Connect authentification, and to
@@ -106,13 +98,13 @@ The json files with mock returns are located in the `mocks` folder in the root o
10698
To test if this works, patiently wait for:
10799

108100
```sh
109-
docker compose --profile oidc up --detach
101+
docker compose up --detach
110102
```
111103

112104
To test if it works, run (should return something starting with `HTTP/1.1 200 OK`)
113105

114106
```sh
115-
curl -d '{}' "http://$(docker compose --profile oidc port idp_mock_api 3030)/users"
107+
curl -d '{}' "http://$(docker compose port idp_mock_api 3030)/users"
116108
```
117109

118110
or
@@ -188,6 +180,6 @@ above config file (here, `userprincipalname`).
188180
### Test delta sync
189181

190182
```sh
191-
docker compose --profile oidc up --detach
183+
docker compose --profile oidc-api up --detach
192184
./test-delta-sync
193185
```

0 commit comments

Comments
 (0)