Closed vincz777 closed 6 months ago
/cc @geoand (devservices,testing), @stuartwdouglas (devservices)
@vincz777 FYI, we have a lot of QuarkusIntegrationTests relying on Keycloak DevService, so please provide a reproducer. I'm not sure at what point HTTPS gets into the picture, please clarify. Thanks
Okay I will provide a reproducer. When I try to login into the admin console of the Keycloak container I get this message in the UI:
@vincz777 I see you are on 3.2.6... Can you please retry in the latest 3.7.x just to check if it works ? Something may indeed be broken in 3.2.6...Reproducer would still help though
Closing as we did not receive feedback
Describe the bug
When running a
@QuarkusTest
using the Keycloack Dev Service, everything works as expected. However running the exact same test as a@QuarkusIntegrationTest
results in an error. Those lines are visible in the logs:When running the test in debug mode, setting a breakpoint in class
KeycloakDevServicesProcessor
where the admin token is retrieved, and running those commands from inside the Keycloack container:then the errors in the logs disappear.
Adding a breakpoint in my test before I try to get a token with
keycloakClient.getClientAccessToken()
, if I do this in the container:Then the test passes as in the case of a simple
@QuarkusTest
Expected behavior
The Keycloack Dev Service should work when running integration tests.
Actual behavior
The Keycloack Dev Service is not usable for integration tests as it seems there is some missing configuration about allowing access without SSL.
How to Reproduce?
Create a simple test in a project using Quarkus OIDC. In the test retrieve a client token:
Run the test with annotation
@QuarkusTest
and observe the test passes.Run the test with annotation
@QuarkusIntegrationTest
and observe the test fails.Output of
uname -a
orver
Linux 5.15.0-94-generic #104~20.04.1-Ubuntu SMP Tue Jan 16 13:34:09 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
java version "21" 2023-09-19 LTS Java(TM) SE Runtime Environment (build 21+35-LTS-2513) Java HotSpot(TM) 64-Bit Server VM (build 21+35-LTS-2513, mixed mode, sharing)
Quarkus version or git rev
3.2.6.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546)
Additional information
This link was helpful to understand what may be wrong: https://stackoverflow.com/questions/30622599/https-required-while-logging-in-to-keycloak-as-admin