Please provide us with the following information:
This issue is for a: (mark with an x)
- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
Minimal steps to reproduce
- Spring Framework Web App Tutorial/3-Authorization-II -
- Run application and log in.
- Observe ID Token Details and confirm that groups claim contains the AdminGroupId and the UserGroupId.
- Confirm that PreAuthorization annotations have the 'correct' Group IDs
- Click Admins Only.
Any log messages given by the failure
None observed
Expected/desired behavior
Expected: "Excellent! ..."
Observed: "Sorry! ..."
OS and Version?
macOS Big Sur
Versions
Java version 11
Mention any other details that might be useful
@GetMapping(path = "/admin_only")
@PreAuthorize("hasAuthority('48ca69cc-8f4f-4bd2-b12f-xxxxxxxxxxxx')")
Does not work.
Changing the PreAuthorization to hasRole() and Prefixing the group id with "ROLE_" as documented here appears to be working:
The roles example works as expected.
Thanks! We'll be in touch soon.