File tree 6 files changed +22
-30
lines changed
api/src/Security/Http/Protection
6 files changed +22
-30
lines changed Original file line number Diff line number Diff line change @@ -114,14 +114,18 @@ private function getTokenEndpoint(): string
114
114
$ response = $ this ->securityAuthorizationClient ->request ('GET ' , '.well-known/openid-configuration ' );
115
115
$ content = $ response ->toArray ();
116
116
117
- return $ content ['token_endpoint ' ];
117
+ // horrible fix for local development, can't find another way to fix it
118
+ // since bitnami/keycloak:^25 returns the configured hostname instead of the requested one
119
+ return \preg_replace ('#^https?://localhost/# ' , 'http://keycloak:8080/ ' , $ content ['token_endpoint ' ]);
118
120
}
119
121
120
122
private function getResourceRegistrationEndpoint (): string
121
123
{
122
124
$ response = $ this ->securityAuthorizationClient ->request ('GET ' , '.well-known/uma2-configuration ' );
123
125
$ content = $ response ->toArray ();
124
126
125
- return $ content ['resource_registration_endpoint ' ];
127
+ // horrible fix for local development, can't find another way to fix it
128
+ // since bitnami/keycloak:^25 returns the configured hostname instead of the requested one
129
+ return \preg_replace ('#^https?://localhost/# ' , 'http://keycloak:8080/ ' , $ content ['resource_registration_endpoint ' ]);
126
130
}
127
131
}
Original file line number Diff line number Diff line change @@ -5,11 +5,8 @@ services:
5
5
KEYCLOAK_HTTPS_USE_PEM : " true"
6
6
KEYCLOAK_HTTPS_CERTIFICATE_FILE : /opt/bitnami/keycloak/certs/tls.crt
7
7
KEYCLOAK_HTTPS_CERTIFICATE_KEY_FILE : /opt/bitnami/keycloak/certs/tls.key
8
+ KEYCLOAK_EXTRA_ARGS : " --features=\" hostname:v2,scripts,persistent-user-sessions:v1\" --import-realm"
8
9
volumes :
9
10
- ./helm/api-platform/keycloak/certs/tls.crt:/opt/bitnami/keycloak/certs/tls.crt:ro
10
11
- ./helm/api-platform/keycloak/certs/tls.pem:/opt/bitnami/keycloak/certs/tls.key:ro
11
-
12
- keycloak-config-cli :
13
- extends :
14
- file : compose.override.yaml
15
- service : keycloak-config-cli
12
+ - ./helm/api-platform/keycloak/config:/opt/bitnami/keycloak/data/import
Original file line number Diff line number Diff line change @@ -50,17 +50,8 @@ services:
50
50
build :
51
51
context : ./helm/api-platform/keycloak/
52
52
target : keycloak
53
- volumes :
54
- - ./helm/api-platform/keycloak/themes/api-platform-demo:/opt/bitnami/keycloak/themes/api-platform-demo
55
-
56
- keycloak-config-cli :
57
- image : bitnami/keycloak-config-cli:5-debian-12
58
53
environment :
59
- KEYCLOAK_URL : http://keycloak:8080/oidc/
60
- KEYCLOAK_USER : ${KEYCLOAK_ADMIN_USER:-admin}
61
- KEYCLOAK_PASSWORD : ${KEYCLOAK_ADMIN_PASSWORD:-!ChangeMe!}
62
- KEYCLOAK_AVAILABILITYCHECK_ENABLED : " true"
63
- KEYCLOAK_AVAILABILITYCHECK_TIMEOUT : 120s
64
- IMPORT_FILES_LOCATIONS : " /config/*"
54
+ KEYCLOAK_EXTRA_ARGS : " --features=\" hostname:v2,scripts,persistent-user-sessions:v1\" --import-realm"
65
55
volumes :
66
- - ./helm/api-platform/keycloak/config:/config
56
+ - ./helm/api-platform/keycloak/themes/api-platform-demo:/opt/bitnami/keycloak/themes/api-platform-demo
57
+ - ./helm/api-platform/keycloak/config:/opt/bitnami/keycloak/data/import
Original file line number Diff line number Diff line change @@ -83,11 +83,9 @@ services:
83
83
KEYCLOAK_ADMIN_PASSWORD : ${KEYCLOAK_ADMIN_PASSWORD:-!ChangeMe!}
84
84
# Must finish with a trailing slash (https://github.com/bitnami/charts/issues/10885#issuecomment-1414279144)
85
85
KEYCLOAK_HTTP_RELATIVE_PATH : /oidc/
86
- # https://www.keycloak.org/server/hostname
87
- KC_HOSTNAME_URL : https://${SERVER_NAME:-localhost}/oidc/
88
- KC_HOSTNAME_ADMIN_URL : https://${SERVER_NAME:-localhost}/oidc/
89
- # https://www.keycloak.org/server/features
90
- KC_FEATURES : " scripts"
86
+ KEYCLOAK_HOSTNAME : https://${SERVER_NAME:-localhost}/oidc/
87
+ KEYCLOAK_HOSTNAME_ADMIN : https://${SERVER_NAME:-localhost}/oidc/
88
+ KEYCLOAK_EXTRA_ARGS : " --features=\" hostname:v2,scripts,persistent-user-sessions:v1\" "
91
89
depends_on :
92
90
- keycloak-database
93
91
ports :
Original file line number Diff line number Diff line change 4
4
5
5
6
6
# Versions
7
- FROM bitnami/keycloak:24 -debian-12 AS keycloak_upstream
7
+ FROM bitnami/keycloak:25 -debian-12 AS keycloak_upstream
8
8
9
9
10
10
# The different stages of this Dockerfile are meant to be built into separate images
Original file line number Diff line number Diff line change @@ -108,14 +108,16 @@ keycloak:
108
108
service :
109
109
type : ClusterIP
110
110
extraEnvVars :
111
- # Must set KC_HOSTNAME_URL to force https + relative path
112
- - name : KC_HOSTNAME_URL
111
+ # Must set KEYCLOAK_HOSTNAME to force https + relative path
112
+ - name : KEYCLOAK_HOSTNAME
113
113
value : " https://chart-example.local/oidc/"
114
- # Must set KC_HOSTNAME_ADMIN because of relative path
115
- - name : KC_HOSTNAME_ADMIN_URL
114
+ # Must set KEYCLOAK_HOSTNAME_ADMIN because of relative path
115
+ - name : KEYCLOAK_HOSTNAME_ADMIN
116
116
value : " https://chart-example.local/oidc/"
117
117
- name : KEYCLOAK_PRODUCTION
118
118
value : " true"
119
+ - name : KEYCLOAK_EXTRA_ARGS
120
+ value : " --features=\" hostname:v2,scripts,persistent-user-sessions:v1\" "
119
121
# must finish with a trailing slash (https://github.com/bitnami/charts/issues/10885#issuecomment-1414279144)
120
122
httpRelativePath : /oidc/
121
123
proxy : edge
@@ -137,7 +139,7 @@ keycloak:
137
139
- -jar
138
140
- /opt/bitnami/keycloak-config-cli/keycloak-config-cli.jar
139
141
image :
140
- tag : 5 -debian-12
142
+ tag : 6 -debian-12
141
143
postgresql :
142
144
enabled : true
143
145
nameOverride : postgresql-keycloak
You can’t perform that action at this time.
0 commit comments