Replies: 1 comment 1 reply
-
There's most probably a difference in the configuration of your "original" Keycloak and the realm export you are importing on startup in the testcontainer. Most likely it's the scope configuration of the used client, as the scope config is responsible which roles are mapped into the token, but it may be that it's another setting in your Keycloak environment. The container used by this testcontainer extension does not differ from the original Keycloak container, as it is the same. The code contained in this library is just for managing and being able to configure the container. So, the code of this library does not do generate different configuration, as the configuration is coming directly from your imported realm file. |
Beta Was this translation helpful? Give feedback.
-
My Keycloak 20.0.0 container start correctly from my export realm, I added a user manually. I login witht his user and get a token, but when use this token to test an endpoint authorized by role, spring security parse the token inside and obtain an error because don't exist the claim realm_access.
If I login to my original keycloak this claim exist inside the token issued, but he container with keycloak generated by your library not. Exist some configuration to add to obtain a token with this claim inside?
This is the token generated by your keycloak cotainer generated in test mode:
This is the token genereted by my original keycloak. You will see this claim realm_access inside with my role MANAGER
Beta Was this translation helpful? Give feedback.
All reactions