I am wondering what's the best way to this. My scenario is the following:
I have separate oath2 server and resource server sharing the auth information via database. The user authentication is being made by a provider that extends from AbstractUserDetailsAuthenticationProvider. Whenever I build UserDetails object, I attach the authorities to that user details. The thing is, a specific call to my resource server might change the user authorities. As far as I understand the UserDetails is stored serialized in the database which it seems to make the process even more difficult.
My question: is that a way of doing this right? Or better, is the API prepared to handle such requirement? If not what are my options here?
Also note that the server that will make somehow a possible change in the authorities is the resource server and not the one running the oauth2 stuff.