Sample project to test authentication using Keycloak with Spring Boot 2.0 OAuth2 Client.
See also Spring Security: Mapping User Authorities
Works fine except that user always get ROLE_USER
authority instead of the one defined in keycloak :-(
- Import realm config
realm-export.json
to Keycloak - Edit
spring-boot-test
client to add a newadmin
role - Create a user with
admin
role withinspring-boot-test
client
- Update
src/main/resources/application.yml
with keycloak url - Run application:
./mvnw spring-boot:run
- Go to http://localhost:8080 and login
- User will have
ROLE_USER
authority instead ofadmin
:-(