| Username | Password | Role | ID Token |
|---|---|---|---|
| john alice bob | 12345 12345 12345 |
EMPLOYEE CUSTOMER CUSTOMER |
eyJhbGci...QYCMY4AQ eyJhbGci...oaJguQ5w eyJhbGci...vOPIUjZg |
spring-boot-starter-security and spring-security-oauth2-jose Maven dependencies with the spring-boot-starter-oauth2-resource-server dependency and remove all JWT classes from the previous exercise.
SecurityConfig as follows:
JwtAuthenticationFilter with support for a resource server using JWT tokens.
roles and the prefix ROLE_ for authority mapping and the claim username for principal mapping
spring.security.oauth2.resourceserver.jwt.issuer-uri to the address https://auth.distsys.ch/auth/realms/bfh of the Keycloak server.