git.iko.soy/typeable/oauth2-proxy
on master help sign in
chore(examples): update keycloak to v25 (#2706)

--------- Co-authored-by: tuunit <jan@larwig.com>

commitce8b63bc21399ed8bf6c94e3c863b5bc1df0c4e5 authorKoen van Zuijlen <8818390+kvanzuijlen@users.noreply.github.com> dateThu 18 Jul 2024, 23:57 (2 years ago) parentca25c90
4 files changed+31−36
contrib/local-environment/docker-compose-keycloak.yaml+8−13 contrib/local-environment/keycloak/master-realm.json → contrib/local-environment/keycloak/oauth2-proxy-realm.json+18−18 contrib/local-environment/keycloak/master-users-0.json → contrib/local-environment/keycloak/oauth2-proxy-users-0.json+1−1 contrib/local-environment/oauth2-proxy-keycloak.cfg+4−4
contrib/local-environment/docker-compose-keycloak.yaml+8−13
@@ -43,23 +43,18 @@ services:
4343
4444 keycloak:
4545 container_name: keycloak
46− image: jboss/keycloak:10.0.2
46+ image: keycloak/keycloak:25.0.1-0
4747 hostname: keycloak
4848 command:
49− [
50− '-b',
51− '0.0.0.0',
52− '-Djboss.socket.binding.port-offset=1000',
53− '-Dkeycloak.migration.action=import',
54− '-Dkeycloak.migration.provider=dir',
55− '-Dkeycloak.migration.dir=/realm-config',
56− '-Dkeycloak.migration.strategy=IGNORE_EXISTING'
57− ]
49+ - 'start-dev'
50+ - '--http-port=9080'
51+ - '--import-realm'
5852 volumes:
59− - ./keycloak:/realm-config
53+ - ./keycloak:/opt/keycloak/data/import
6054 environment:
61− KEYCLOAK_USER: admin@example.com
62− KEYCLOAK_PASSWORD: password
55+ KC_HTTP_PORT: 9080
56+ KEYCLOAK_ADMIN: admin@example.com
57+ KEYCLOAK_ADMIN_PASSWORD: password
6358 ports:
6459 - 9080:9080/tcp
6560 networks:
contrib/local-environment/keycloak/master-realm.json → contrib/local-environment/keycloak/oauth2-proxy-realm.jsonrenamed+18−18
@@ -1,6 +1,6 @@
11{
2− "id": "master",
3− "realm": "master",
2+ "id": "oauth2-proxy",
3+ "realm": "oauth2-proxy",
44 "displayName": "Keycloak",
55 "displayNameHtml": "<div class=\"kc-logo-text\"><span>Keycloak</span></div>",
66 "notBefore": 0,
@@ -48,7 +48,7 @@
4848 "description": "${role_offline-access}",
4949 "composite": false,
5050 "clientRole": false,
51− "containerId": "master",
51+ "containerId": "oauth2-proxy",
5252 "attributes": {}
5353 },
5454 {
@@ -61,7 +61,7 @@
6161 "create-realm"
6262 ],
6363 "client": {
64− "master-realm": [
64+ "oauth2-proxy-realm": [
6565 "query-groups",
6666 "create-client",
6767 "query-realms",
@@ -84,7 +84,7 @@
8484 }
8585 },
8686 "clientRole": false,
87− "containerId": "master",
87+ "containerId": "oauth2-proxy",
8888 "attributes": {}
8989 },
9090 {
@@ -93,7 +93,7 @@
9393 "description": "${role_uma_authorization}",
9494 "composite": false,
9595 "clientRole": false,
96− "containerId": "master",
96+ "containerId": "oauth2-proxy",
9797 "attributes": {}
9898 },
9999 {
@@ -102,7 +102,7 @@
102102 "description": "${role_create-realm}",
103103 "composite": false,
104104 "clientRole": false,
105− "containerId": "master",
105+ "containerId": "oauth2-proxy",
106106 "attributes": {}
107107 }
108108 ],
@@ -122,7 +122,7 @@
122122 "attributes": {}
123123 }
124124 ],
125− "master-realm": [
125+ "oauth2-proxy-realm": [
126126 {
127127 "id": "a8271c2c-6437-4ca5-ae83-49ea5fe1318d",
128128 "name": "query-groups",
@@ -229,7 +229,7 @@
229229 "composite": true,
230230 "composites": {
231231 "client": {
232− "master-realm": [
232+ "oauth2-proxy-realm": [
233233 "query-groups",
234234 "query-users"
235235 ]
@@ -273,7 +273,7 @@
273273 "composite": true,
274274 "composites": {
275275 "client": {
276− "master-realm": [
276+ "oauth2-proxy-realm": [
277277 "query-clients"
278278 ]
279279 }
@@ -439,7 +439,7 @@
439439 "clientId": "account",
440440 "name": "${client_account}",
441441 "rootUrl": "${authBaseUrl}",
442− "baseUrl": "/realms/master/account/",
442+ "baseUrl": "/realms/oauth2-proxy/account/",
443443 "surrogateAuthRequired": false,
444444 "enabled": true,
445445 "alwaysDisplayInConsole": false,
@@ -450,7 +450,7 @@
450450 "manage-account"
451451 ],
452452 "redirectUris": [
453− "/realms/master/account/*"
453+ "/realms/oauth2-proxy/account/*"
454454 ],
455455 "webOrigins": [],
456456 "notBefore": 0,
@@ -486,14 +486,14 @@
486486 "clientId": "account-console",
487487 "name": "${client_account-console}",
488488 "rootUrl": "${authBaseUrl}",
489− "baseUrl": "/realms/master/account/",
489+ "baseUrl": "/realms/oauth2-proxy/account/",
490490 "surrogateAuthRequired": false,
491491 "enabled": true,
492492 "alwaysDisplayInConsole": false,
493493 "clientAuthenticatorType": "client-secret",
494494 "secret": "91f85142-ee18-4e30-9949-e5acb701bdee",
495495 "redirectUris": [
496− "/realms/master/account/*"
496+ "/realms/oauth2-proxy/account/*"
497497 ],
498498 "webOrigins": [],
499499 "notBefore": 0,
@@ -616,8 +616,8 @@
616616 },
617617 {
618618 "id": "7174c175-1887-4e57-b95b-969fe040deff",
619− "clientId": "master-realm",
620− "name": "master Realm",
619+ "clientId": "oauth2-proxy-realm",
620+ "name": "oauth2-proxy Realm",
621621 "surrogateAuthRequired": false,
622622 "enabled": true,
623623 "alwaysDisplayInConsole": false,
@@ -711,14 +711,14 @@
711711 "clientId": "security-admin-console",
712712 "name": "${client_security-admin-console}",
713713 "rootUrl": "${authAdminUrl}",
714− "baseUrl": "/admin/master/console/",
714+ "baseUrl": "/admin/oauth2-proxy/console/",
715715 "surrogateAuthRequired": false,
716716 "enabled": true,
717717 "alwaysDisplayInConsole": false,
718718 "clientAuthenticatorType": "client-secret",
719719 "secret": "b234b7aa-8417-410f-b3fd-c57434d3aa4a",
720720 "redirectUris": [
721− "/admin/master/console/*"
721+ "/admin/oauth2-proxy/console/*"
722722 ],
723723 "webOrigins": [
724724 "+"
contrib/local-environment/keycloak/master-users-0.json → contrib/local-environment/keycloak/oauth2-proxy-users-0.jsonrenamed+1−1
@@ -1,5 +1,5 @@
11{
2− "realm": "master",
2+ "realm": "oauth2-proxy",
33 "users": [
44 {
55 "id": "3356c0a0-d4d5-4436-9c5a-2299c71c08ec",
contrib/local-environment/oauth2-proxy-keycloak.cfg+4−4
@@ -2,8 +2,8 @@ http_address="0.0.0.0:4180"
22cookie_secret="OQINaROshtE9TcZkNAm-5Zs2Pv3xaWytBmc5W7sPX7w="
33email_domains="example.com"
44cookie_secure="false"
5−upstreams="http://httpbin.localtest.me:8080"
6−cookie_domains=[".localtest.me"] # Required so cookie can be read on all subdomains.
5+upstreams="http://httpbin"
6+cookie_domains=["oauth2-proxy.localtest.me:4080", "httpbin.localtest.me:8080", "keycloak.localtest.me:9080"] # Required so cookie can be read on all subdomains.
77whitelist_domains=[".localtest.me"] # Required to allow redirection back to original requested target.
88
99# keycloak provider
@@ -12,7 +12,7 @@ client_id="oauth2-proxy"
1212redirect_url="http://oauth2-proxy.localtest.me:4180/oauth2/callback"
1313
1414# in this case oauth2-proxy is going to visit
15−# http://keycloak.localtest.me:9080/auth/realms/master/.well-known/openid-configuration for configuration
16−oidc_issuer_url="http://keycloak.localtest.me:9080/auth/realms/master"
15+# http://keycloak.localtest.me:9080/realms/oauth2-proxy/.well-known/openid-configuration for configuration
16+oidc_issuer_url="http://keycloak.localtest.me:9080/realms/oauth2-proxy"
1717provider="oidc"
1818provider_display_name="Keycloak"