PreAuthorise in Resource server not working #237
-
Hi there, I've created a OAuth2 BFF with the spring-addons-starter-oidc, with Angular front-end, following Jerome's example project. When I create a function on the controller with @Preauthorise, the system fails with 401 Unauthorized, despite the test user having the correct permissions. Any help will be highly appriciated Here is my code: Proxy:
BFF:
Resource Server:
An finally......the problem resource server QueryCommandServer:
and its REST API
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 9 replies
-
What is the What is the request path? What is the token payload? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I am sorry to ask this as I read through all the documentation and your sample project code. I am not sure how to get my server to revert to using session cookies and not a Bearer token as stated in step 1. Do you maybe have an example of a resource sever that uses @PreAuthorize so I can study the code? I have implemented step 4 using @EnableReactiveMethodSecurity in my code. Thank you for all your help regarding this. |
Beta Was this translation helpful? Give feedback.
-
Thanks for all your help with this. It's working!!!! If this helps anyone else, here is what I did:
So here is what my full settings looks like:
|
Beta Was this translation helpful? Give feedback.
Thanks for all your help with this.
It's working!!!!
If this helps anyone else, here is what I did:
So in my case, I added my two test servers called querymanagerquery, and querymanagercommand to the security-matches section in the settings as follows:
So here is what my full settings looks like: