-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.oidc.yml
321 lines (301 loc) · 10.5 KB
/
docker-compose.oidc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
services:
# https://github.com/Soluto/oidc-server-mock
idp-citizen:
image: ghcr.io/soluto/oidc-server-mock:latest
profiles:
- oidc
- test
# Let this container be accessible both internally and externally on the same domain.
container_name: idp-citizen.${COMPOSE_DOMAIN}
networks:
- app
- frontend
ports:
- '80'
volumes:
- .:/tmp/config:ro
labels:
- "traefik.enable=true"
- "traefik.docker.network=frontend"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}_idp-citizen.rule=Host(`idp-citizen.${COMPOSE_DOMAIN}`)"
- "traefik.http.services.${COMPOSE_PROJECT_NAME}_idp-citizen.loadbalancer.server.port=443"
- "traefik.http.services.${COMPOSE_PROJECT_NAME}_idp-citizen.loadbalancer.server.scheme=https"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}_idp-citizen.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
environment:
# https://github.com/Soluto/oidc-server-mock?tab=readme-ov-file#https
ASPNETCORE_URLS: https://+:443;http://+:80
ASPNETCORE_Kestrel__Certificates__Default__Password: mock
ASPNETCORE_Kestrel__Certificates__Default__Path: /tmp/config/.docker/oidc-server-mock/cert/docker.pfx
ASPNETCORE_ENVIRONMENT: Development
SERVER_OPTIONS_INLINE: |
AccessTokenJwtType: JWT
Discovery:
ShowKeySet: true
Authentication:
CookieSameSiteMode: Lax
CheckSessionCookieSameSiteMode: Lax
LOGIN_OPTIONS_INLINE: |
{
"AllowRememberLogin": false
}
LOGOUT_OPTIONS_INLINE: |
{
"AutomaticRedirectAfterSignOut": true
}
CLIENTS_CONFIGURATION_INLINE: |
- ClientId: client-id
ClientSecrets: [client-secret]
Description: Mock IdP
AllowedGrantTypes:
# - client_credentials
# - implicit
- authorization_code
# https://github.com/Soluto/oidc-server-mock/issues/46#issuecomment-704963181
RequireClientSecret: false
AllowAccessTokensViaBrowser: true
# https://github.com/Soluto/oidc-server-mock/issues/26#issuecomment-705022941
AlwaysIncludeUserClaimsInIdToken: true
AllowedScopes:
- openid
- profile
- email
ClientClaimsPrefix: ''
RedirectUris:
- '*'
# https://github.com/Soluto/oidc-server-mock/issues/60
PostLogoutRedirectUris:
- '*'
# https://github.com/Soluto/oidc-server-mock/issues/46#issuecomment-704845375
RequirePkce: false
# Needed to set custom claim types in "profile"
# https://github.com/Soluto/oidc-server-mock/issues/123#issuecomment-1427129278
# https://github.com/Soluto/oidc-server-mock/blob/master/README.md#simple-configuration
# https://docs.docker.com/compose/compose-file/compose-file-v3/#environment
OVERRIDE_STANDARD_IDENTITY_RESOURCES: 'true'
IDENTITY_RESOURCES_INLINE: |
# https://auth0.com/docs/get-started/apis/scopes/openid-connect-scopes#standard-claims
- Name: openid
ClaimTypes:
- sub
- Name: email
ClaimTypes:
- email
- Name: profile
ClaimTypes:
# Add your custom claims here
- dk_ssn
- name
- zip
USERS_CONFIGURATION_INLINE: |
- SubjectId: 1
Username: citizen1
Password: citizen1
Claims:
# Claims added here must be defined above in IDENTITY_RESOURCES_INLINE
- Type: dk_ssn
Value: '1111111111'
ValueType: string
- Type: name
Value: 'Anders And'
ValueType: string
- Type: zip
Value: '1111'
ValueType: string
- SubjectId: 2
Username: citizen2
Password: citizen2
Claims:
- Type: dk_ssn
Value: '2222222222'
ValueType: string
- Type: name
Value: 'Bent Betjentsen'
ValueType: string
- Type: zip
Value: '2222'
ValueType: string
- SubjectId: 3
Username: citizen3
Password: citizen3
Claims:
- Type: dk_ssn
Value: '3333333333'
ValueType: string
- Type: name
Value: 'Carsten Carlsen'
ValueType: string
- Type: zip
Value: '3333'
ValueType: string
- SubjectId: 4
Username: citizen4
Password: citizen4
Claims:
- Type: dk_ssn
Value: '4444444444'
ValueType: string
- Type: name
Value: 'Dorte Dyhr'
ValueType: string
- Type: zip
Value: '4444'
ValueType: string
- SubjectId: 'ikke-aarhusianer'
Username: 'ikke-aarhusianer'
Password: 'ikke-aarhusianer'
Claims:
- Type: dk_ssn
Value: '1705880000'
ValueType: string
- Type: name
Value: Troels Bondetest
ValueType: string
- SubjectId: 'aarhusianer'
Username: 'aarhusianer'
Password: 'aarhusianer'
Claims:
- Type: dk_ssn
Value: '2611740000'
ValueType: string
- Type: name
Value: Betina Henningsentest
ValueType: string
# https://github.com/Soluto/oidc-server-mock
idp-employee:
image: ghcr.io/soluto/oidc-server-mock:latest
profiles:
- oidc
- test
# Let this container be accessible both internally and externally on the same domain.
container_name: idp-employee.${COMPOSE_DOMAIN}
networks:
- app
- frontend
ports:
- '80'
volumes:
- .:/tmp/config:ro
labels:
- "traefik.enable=true"
- "traefik.docker.network=frontend"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}_idp-employee.rule=Host(`idp-employee.${COMPOSE_DOMAIN}`)"
- "traefik.http.services.${COMPOSE_PROJECT_NAME}_idp-employee.loadbalancer.server.port=443"
- "traefik.http.services.${COMPOSE_PROJECT_NAME}_idp-employee.loadbalancer.server.scheme=https"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}_idp-employee.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
environment:
# https://github.com/Soluto/oidc-server-mock?tab=readme-ov-file#https
ASPNETCORE_URLS: https://+:443;http://+:80
ASPNETCORE_Kestrel__Certificates__Default__Password: mock
ASPNETCORE_Kestrel__Certificates__Default__Path: /tmp/config/.docker/oidc-server-mock/cert/docker.pfx
ASPNETCORE_ENVIRONMENT: Development
SERVER_OPTIONS_INLINE: |
AccessTokenJwtType: JWT
Discovery:
ShowKeySet: true
Authentication:
CookieSameSiteMode: Lax
CheckSessionCookieSameSiteMode: Lax
LOGIN_OPTIONS_INLINE: |
{
"AllowRememberLogin": false
}
LOGOUT_OPTIONS_INLINE: |
{
"AutomaticRedirectAfterSignOut": true
}
CLIENTS_CONFIGURATION_INLINE: |
- ClientId: client-id
ClientSecrets: [client-secret]
Description: Mock IdP
AllowedGrantTypes:
# - client_credentials
# - implicit
- authorization_code
# https://github.com/Soluto/oidc-server-mock/issues/46#issuecomment-704963181
RequireClientSecret: false
AllowAccessTokensViaBrowser: true
# https://github.com/Soluto/oidc-server-mock/issues/26#issuecomment-705022941
AlwaysIncludeUserClaimsInIdToken: true
AllowedScopes:
- openid
- profile
- email
ClientClaimsPrefix: ''
RedirectUris:
- '*'
# https://github.com/Soluto/oidc-server-mock/issues/60
PostLogoutRedirectUris:
- '*'
# https://github.com/Soluto/oidc-server-mock/issues/46#issuecomment-704845375
RequirePkce: false
# Needed to set custom claim types in "profile"
# https://github.com/Soluto/oidc-server-mock/issues/123#issuecomment-1427129278
# https://github.com/Soluto/oidc-server-mock/blob/master/README.md#simple-configuration
# https://docs.docker.com/compose/compose-file/compose-file-v3/#environment
OVERRIDE_STANDARD_IDENTITY_RESOURCES: 'true'
IDENTITY_RESOURCES_INLINE: |
# https://auth0.com/docs/get-started/apis/scopes/openid-connect-scopes#standard-claims
- Name: openid
ClaimTypes:
- sub
- Name: email
ClaimTypes:
- email
- Name: profile
ClaimTypes:
# Add your custom claims here
- name
- groups
- magistratsafdeling
USERS_CONFIGURATION_INLINE: |
- SubjectId: 1
Username: department1-admin
Password: department1-admin
Claims:
# Claims added here must be defined above in IDENTITY_RESOURCES_INLINE
- Type: email
Value: '[email protected]'
ValueType: string
- Type: name
Value: 'department1-admin'
ValueType: string
- Type: magistratsafdeling
Value: 'Department 1'
ValueType: string
- Type: groups
Value: '["administrator"]'
ValueType: json
- SubjectId: 2
Username: department2-editor
Password: department2-editor
Claims:
- Type: email
Value: '[email protected]'
ValueType: string
- Type: name
Value: 'department2-editor'
ValueType: string
- Type: magistratsafdeling
Value: 'Department 2'
ValueType: string
- Type: groups
Value: '["editor"]'
ValueType: json
- SubjectId: 3
Username: department3-editor
Password: department3-editor
Claims:
- Type: email
Value: '[email protected]'
ValueType: string
- Type: name
Value: 'department3-editor'
ValueType: string
- Type: magistratsafdeling
Value: 'Department 3'
ValueType: string
- Type: groups
Value: '["editor"]'
ValueType: json