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

feat: keycloak internal server URL #304

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

MasterCarl
Copy link
Contributor

This PR adds a new configuration option serverUrlInternal to the Keycloak provider.

  • If set, serverUrlInternal is used instead of serverUrl to request the access token from the Keycloak server: ${config.serverUrlInternal || config.serverUrl}/realms/${config.realm}
  • Meanwhile, the client redirect keeps using serverUrl: ${config.serverUrl}/realms/${config.realm}

Use case

In our end-to-end tests, both Keycloak and Nuxt run in Docker via docker compose. Nuxt accesses Keycloak via http://keycloak:8080. However, the browser runs outside of Docker and talks to both services via localhost URLs.
The new configuration option simplifies the setup by allowing the browser to be redirected to http://localhost:8080, while the token is retrieved from http://keycloak:8080.

@MasterCarl MasterCarl changed the title Feat/keycloak internal server url feat: keycloak internal server URL Dec 12, 2024
Copy link

pkg-pr-new bot commented Dec 13, 2024

Open in Stackblitz

npm i https://pkg.pr.new/atinux/nuxt-auth-utils@304

commit: 7a54c10

@atinux atinux merged commit ac61ae5 into atinux:main Dec 13, 2024
4 checks passed
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.

2 participants