Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hostName change is not correctly propagated into Keycloak #194

Open
semik opened this issue Aug 1, 2024 · 0 comments
Open

hostName change is not correctly propagated into Keycloak #194

semik opened this issue Aug 1, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@semik
Copy link
Contributor

semik commented Aug 1, 2024

Describe the bug

After changing hostName in values file, the new value is not correctly propagated to Keycloak.

To Reproduce
Steps to reproduce the behavior:

  1. Install CZERTAINLY with some hostname, for example czertainly11.local.
  2. Check everything is working including login with Keycloak.
  3. Change hostname to some new value, redeploy using helm.
  4. Try to login with username / password, ie. using Keycloak and see error Invalid parameter: redirect_uri. In logs of Keycloak is error message 2024-08-01 07:37:50,362 WARN [org.keycloak.events] (executor-thread-3) type="LOGIN_ERROR", realmId="1595e715-e7d0-417a-8df5-77bbdde4e8d8", clientId="kong", userId="null", ipAddress="192.168.1.12", error="invalid_redirect_uri", redirect_uri="https://czertainly-big.local/login/"

Expected behavior

I think it should be able to change hostname with change in values files for all components of CZERTAINLY.

Screenshots
Screenshot at 2024-08-01 09-47-40
Screenshot at 2024-08-01 09-47-48

Additional context

During startup Keycloak print in logs:

2024-08-01 07:27:08,410 INFO  [org.keycloak.exportimport.singlefile.SingleFileImportProvider] (main) Full importing from file /opt/keycloak/bin/../data/import/czertainly_realm.json
2024-08-01 07:27:09,306 INFO  [org.keycloak.exportimport.util.ImportUtils] (main) Realm 'CZERTAINLY' already exists. Import skipped
2024-08-01 07:27:09,318 INFO  [org.keycloak.exportimport.dir.DirImportProvider] (main) Importing from directory /opt/keycloak/bin/../data/import

I underand this that any change in in czertanly_realm.json is ignored after initial import.

Note on screenshot that all URLs have changed, except of the one for kong client. I think that instead of "rootUrl" : "https://{{ required "Hostname must be provided: .Values.czertainly.hostName" $hostName }}", we should use "rootUrl" : "${authBaseUrl}", which is used for example with clientID account-console.

I can test it and when prove be right I can prepare PR for this change. But not right now. If you agree, please assign me this issue and I will proceed.

@semik semik added the bug Something isn't working label Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants