-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
HTTP 401 Unauthorized response when getting a token #8
Comments
The Keycloak-Testcontainer won't configure itself base on some Spring config properties. Testcontainers have no relation to Spring. Generally, Testcontainers start on a random port on each run. That's the concept of Testcontainers. You have to take care in your Spring test environment/configuration to set the appropriate url/port of Keycloak after Keycloak-Testcontainer has startet. Please consult the Spring docs on how to do that. I'm not a Spring guy, I don't know how this can be achieved, I only know that it is possible and also a well-known and wide-used practice. |
I just wonder if:
|
I'm facing the same issue with Spring. Would be great to have a pointer to the widely used practice. |
Please consult the Spring Boot docs for |
I'm trying to run a test using the exported from Keycloack server JSON configuration file as follows:
The
BaseKeycloakTest
class is defined as follows:I'm getting the token in
BaseKeycloakTest
as follows:When running the test, it seems like
realm-export.json
file is not taken in consideration, - the generated token URL looks like that:instead of:
what raises the error:
The
KeucloakConfig
class looks like that:And
application.yml
for tests looks like that:What is wrong with that?
The text was updated successfully, but these errors were encountered: