testcontainers-keycloak | A Testcontainer implementation for Keycloak IAM & SSO | Identity Management library
kandi X-RAY | testcontainers-keycloak Summary
kandi X-RAY | testcontainers-keycloak Summary
This version only handles the new Quarkus distribution of Keycloak (version 17+). For Keycloak-Legacy (Wildfly-based distro), see version 1.x branch.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of testcontainers-keycloak
testcontainers-keycloak Key Features
testcontainers-keycloak Examples and Code Snippets
Community Discussions
Trending Discussions on testcontainers-keycloak
QUESTION
I'm in the process of building a new microservice and securing it with access tokens from Keycloak. So far I've been successful, the endpoint /token/test is only accessible with a valid token from Keycloak, the application properties look like this:
...ANSWER
Answered 2019-Nov-07 at 08:07After some hours of debugging, I finally figured it out. The problem is that Keycloak's authentication is (for whatever reason, lol) done in a Tomcat valve, not in a filter. MockMvc doesn't go through the servlet container (and its valves), so it never even reaches the point where it would be authenticated.
TestRestTemplate does, though (and if you use starter-security, it is also a filter not a valve). I don't know the design decision behind using a valve and not a filter but you can either use the configuration from keycloak-starter and test it with a TestRestTemplate or use the more 'expensive' starter-security configuration in combination with MockMvc.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install testcontainers-keycloak
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page