Description
Describe the bug
We use Spring Security for OAuth2 login using Keycloak. Until Spring Security 5.7.5 the JWT Token validation has worked perfectly.
Since the update at 5.8.0, but also using the newer version, 6.0.0, it stopped working, producing an odd format.
Spring Security 5.7.5:
jwt.getClaimAsString("resource_access")
produces {"notification-entry-service":{"roles":["disease-notification-sender"]}}
Spring Security 5.8.0+:
jwt.getClaimAsString("resource_access")
produces {notification-entry-service={roles=[disease-notification-sender]}}
This happens by simply updating the dependency in the project, without touching/modifying the existing code.
To Reproduce
Setup Spring Security 5.8. 0with OAuth2 and JWT.
Expected behavior
The JWT parsing should not change behaviour (not even reported in the Changelog here - https://docs.spring.io/spring-security/reference/5.8/whats-new.html)
Sample
Could not be provided