1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-15 00:15:00 +02:00

chore(examples): update keycloak to v25 (#2706)

---------

Co-authored-by: tuunit <jan@larwig.com>
This commit is contained in:
Koen van Zuijlen
2024-07-18 23:57:15 +02:00
committed by GitHub
parent ca25c906bb
commit ce8b63bc21
4 changed files with 31 additions and 36 deletions

View File

@ -43,23 +43,18 @@ services:
keycloak: keycloak:
container_name: keycloak container_name: keycloak
image: jboss/keycloak:10.0.2 image: keycloak/keycloak:25.0.1-0
hostname: keycloak hostname: keycloak
command: command:
[ - 'start-dev'
'-b', - '--http-port=9080'
'0.0.0.0', - '--import-realm'
'-Djboss.socket.binding.port-offset=1000',
'-Dkeycloak.migration.action=import',
'-Dkeycloak.migration.provider=dir',
'-Dkeycloak.migration.dir=/realm-config',
'-Dkeycloak.migration.strategy=IGNORE_EXISTING'
]
volumes: volumes:
- ./keycloak:/realm-config - ./keycloak:/opt/keycloak/data/import
environment: environment:
KEYCLOAK_USER: admin@example.com KC_HTTP_PORT: 9080
KEYCLOAK_PASSWORD: password KEYCLOAK_ADMIN: admin@example.com
KEYCLOAK_ADMIN_PASSWORD: password
ports: ports:
- 9080:9080/tcp - 9080:9080/tcp
networks: networks:

View File

@ -1,6 +1,6 @@
{ {
"id": "master", "id": "oauth2-proxy",
"realm": "master", "realm": "oauth2-proxy",
"displayName": "Keycloak", "displayName": "Keycloak",
"displayNameHtml": "<div class=\"kc-logo-text\"><span>Keycloak</span></div>", "displayNameHtml": "<div class=\"kc-logo-text\"><span>Keycloak</span></div>",
"notBefore": 0, "notBefore": 0,
@ -48,7 +48,7 @@
"description": "${role_offline-access}", "description": "${role_offline-access}",
"composite": false, "composite": false,
"clientRole": false, "clientRole": false,
"containerId": "master", "containerId": "oauth2-proxy",
"attributes": {} "attributes": {}
}, },
{ {
@ -61,7 +61,7 @@
"create-realm" "create-realm"
], ],
"client": { "client": {
"master-realm": [ "oauth2-proxy-realm": [
"query-groups", "query-groups",
"create-client", "create-client",
"query-realms", "query-realms",
@ -84,7 +84,7 @@
} }
}, },
"clientRole": false, "clientRole": false,
"containerId": "master", "containerId": "oauth2-proxy",
"attributes": {} "attributes": {}
}, },
{ {
@ -93,7 +93,7 @@
"description": "${role_uma_authorization}", "description": "${role_uma_authorization}",
"composite": false, "composite": false,
"clientRole": false, "clientRole": false,
"containerId": "master", "containerId": "oauth2-proxy",
"attributes": {} "attributes": {}
}, },
{ {
@ -102,7 +102,7 @@
"description": "${role_create-realm}", "description": "${role_create-realm}",
"composite": false, "composite": false,
"clientRole": false, "clientRole": false,
"containerId": "master", "containerId": "oauth2-proxy",
"attributes": {} "attributes": {}
} }
], ],
@ -122,7 +122,7 @@
"attributes": {} "attributes": {}
} }
], ],
"master-realm": [ "oauth2-proxy-realm": [
{ {
"id": "a8271c2c-6437-4ca5-ae83-49ea5fe1318d", "id": "a8271c2c-6437-4ca5-ae83-49ea5fe1318d",
"name": "query-groups", "name": "query-groups",
@ -229,7 +229,7 @@
"composite": true, "composite": true,
"composites": { "composites": {
"client": { "client": {
"master-realm": [ "oauth2-proxy-realm": [
"query-groups", "query-groups",
"query-users" "query-users"
] ]
@ -273,7 +273,7 @@
"composite": true, "composite": true,
"composites": { "composites": {
"client": { "client": {
"master-realm": [ "oauth2-proxy-realm": [
"query-clients" "query-clients"
] ]
} }
@ -439,7 +439,7 @@
"clientId": "account", "clientId": "account",
"name": "${client_account}", "name": "${client_account}",
"rootUrl": "${authBaseUrl}", "rootUrl": "${authBaseUrl}",
"baseUrl": "/realms/master/account/", "baseUrl": "/realms/oauth2-proxy/account/",
"surrogateAuthRequired": false, "surrogateAuthRequired": false,
"enabled": true, "enabled": true,
"alwaysDisplayInConsole": false, "alwaysDisplayInConsole": false,
@ -450,7 +450,7 @@
"manage-account" "manage-account"
], ],
"redirectUris": [ "redirectUris": [
"/realms/master/account/*" "/realms/oauth2-proxy/account/*"
], ],
"webOrigins": [], "webOrigins": [],
"notBefore": 0, "notBefore": 0,
@ -486,14 +486,14 @@
"clientId": "account-console", "clientId": "account-console",
"name": "${client_account-console}", "name": "${client_account-console}",
"rootUrl": "${authBaseUrl}", "rootUrl": "${authBaseUrl}",
"baseUrl": "/realms/master/account/", "baseUrl": "/realms/oauth2-proxy/account/",
"surrogateAuthRequired": false, "surrogateAuthRequired": false,
"enabled": true, "enabled": true,
"alwaysDisplayInConsole": false, "alwaysDisplayInConsole": false,
"clientAuthenticatorType": "client-secret", "clientAuthenticatorType": "client-secret",
"secret": "91f85142-ee18-4e30-9949-e5acb701bdee", "secret": "91f85142-ee18-4e30-9949-e5acb701bdee",
"redirectUris": [ "redirectUris": [
"/realms/master/account/*" "/realms/oauth2-proxy/account/*"
], ],
"webOrigins": [], "webOrigins": [],
"notBefore": 0, "notBefore": 0,
@ -616,8 +616,8 @@
}, },
{ {
"id": "7174c175-1887-4e57-b95b-969fe040deff", "id": "7174c175-1887-4e57-b95b-969fe040deff",
"clientId": "master-realm", "clientId": "oauth2-proxy-realm",
"name": "master Realm", "name": "oauth2-proxy Realm",
"surrogateAuthRequired": false, "surrogateAuthRequired": false,
"enabled": true, "enabled": true,
"alwaysDisplayInConsole": false, "alwaysDisplayInConsole": false,
@ -711,14 +711,14 @@
"clientId": "security-admin-console", "clientId": "security-admin-console",
"name": "${client_security-admin-console}", "name": "${client_security-admin-console}",
"rootUrl": "${authAdminUrl}", "rootUrl": "${authAdminUrl}",
"baseUrl": "/admin/master/console/", "baseUrl": "/admin/oauth2-proxy/console/",
"surrogateAuthRequired": false, "surrogateAuthRequired": false,
"enabled": true, "enabled": true,
"alwaysDisplayInConsole": false, "alwaysDisplayInConsole": false,
"clientAuthenticatorType": "client-secret", "clientAuthenticatorType": "client-secret",
"secret": "b234b7aa-8417-410f-b3fd-c57434d3aa4a", "secret": "b234b7aa-8417-410f-b3fd-c57434d3aa4a",
"redirectUris": [ "redirectUris": [
"/admin/master/console/*" "/admin/oauth2-proxy/console/*"
], ],
"webOrigins": [ "webOrigins": [
"+" "+"

View File

@ -1,5 +1,5 @@
{ {
"realm": "master", "realm": "oauth2-proxy",
"users": [ "users": [
{ {
"id": "3356c0a0-d4d5-4436-9c5a-2299c71c08ec", "id": "3356c0a0-d4d5-4436-9c5a-2299c71c08ec",

View File

@ -2,8 +2,8 @@ http_address="0.0.0.0:4180"
cookie_secret="OQINaROshtE9TcZkNAm-5Zs2Pv3xaWytBmc5W7sPX7w=" cookie_secret="OQINaROshtE9TcZkNAm-5Zs2Pv3xaWytBmc5W7sPX7w="
email_domains="example.com" email_domains="example.com"
cookie_secure="false" cookie_secure="false"
upstreams="http://httpbin.localtest.me:8080" upstreams="http://httpbin"
cookie_domains=[".localtest.me"] # Required so cookie can be read on all subdomains. cookie_domains=["oauth2-proxy.localtest.me:4080", "httpbin.localtest.me:8080", "keycloak.localtest.me:9080"] # Required so cookie can be read on all subdomains.
whitelist_domains=[".localtest.me"] # Required to allow redirection back to original requested target. whitelist_domains=[".localtest.me"] # Required to allow redirection back to original requested target.
# keycloak provider # keycloak provider
@ -12,7 +12,7 @@ client_id="oauth2-proxy"
redirect_url="http://oauth2-proxy.localtest.me:4180/oauth2/callback" redirect_url="http://oauth2-proxy.localtest.me:4180/oauth2/callback"
# in this case oauth2-proxy is going to visit # in this case oauth2-proxy is going to visit
# http://keycloak.localtest.me:9080/auth/realms/master/.well-known/openid-configuration for configuration # http://keycloak.localtest.me:9080/realms/oauth2-proxy/.well-known/openid-configuration for configuration
oidc_issuer_url="http://keycloak.localtest.me:9080/auth/realms/master" oidc_issuer_url="http://keycloak.localtest.me:9080/realms/oauth2-proxy"
provider="oidc" provider="oidc"
provider_display_name="Keycloak" provider_display_name="Keycloak"