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

Update Keycloak backend #57

Merged
merged 7 commits into from
Jan 15, 2025
Merged

Update Keycloak backend #57

merged 7 commits into from
Jan 15, 2025

Conversation

jemrobinson
Copy link
Member

@jemrobinson jemrobinson commented Jan 14, 2025

  • Improves documentation about how to use Keycloak
  • Drops the suggested method of adding a client-scoped mapper to expose a hardcoded domain as this was not working in some cases for an unknown reason
  • Move OAuthDataMapper to once-per-server to simplify various nested constructors
  • Adds a --disable-user-domain-verification flag for cases where domain validation is not wanted
  • Enables --keycloak-domain-attribute to be set from Docker

Closes #54. Closes #55.

@jemrobinson
Copy link
Member Author

@seang96: I think this will solve your problem. You can either set the correct Keycloak domain attribute to whatever your hardcoded attribute name is (using KEYCLOAK_DOMAIN_ATTRIBUTE in Docker or --keycloak-domain-attribute at the command line) or you can ignore domain verification (using DISABLE_USER_DOMAIN_VERIFICATION in Docker or --disable-user-domain-verification at the command line).

If you think this is sufficient, I'll merge this PR into main so you can test the Dockerised version.

@seang96
Copy link

seang96 commented Jan 14, 2025

I don't really need the domain validation so I can test both out. If you publish an image with the PR I could test before you merge.

@jemrobinson jemrobinson force-pushed the 54-fix-keycloak-backend branch from 4e206bb to 5d4209e Compare January 14, 2025 17:20
@jemrobinson
Copy link
Member Author

Thanks! Can you try with docker pull ghcr.io/alan-turing-institute/apricot:54-fix-keycloak-backend?

@seang96
Copy link

seang96 commented Jan 14, 2025

#55 appears good to close with this update!

#54 I can still reproduce the original issue. I am thinking it may be a client side timeout when getting initial access token on first request, if it fails it fails to build the LDAP structure and queries always fail. I'll look into what causes this some more to confirm my theory though.

@jemrobinson
Copy link
Member Author

Thanks @seang96. It's definitely possible for either of

  1. Apricot to make a request to Keycloak before Keycloak is initialised
  2. A user to make a request to Apricot before Apricot is initialised

Do you think one of these is happening in your case?

@jemrobinson jemrobinson merged commit 8769a16 into main Jan 15, 2025
6 checks passed
@jemrobinson jemrobinson deleted the 54-fix-keycloak-backend branch January 15, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keycloak integration - no domain match Getting started with Keycloak/Apricot
2 participants