testcontainers-keycloak | Testing a spring security keycloak integration | Identity Management library
kandi X-RAY | testcontainers-keycloak Summary
kandi X-RAY | testcontainers-keycloak Summary
Keycloak is an open source Identity and Access Management powered by Redhat. The official documentation from Redhat describes:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Entry point for the download .
- Download a file from an URL
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