I deploped the springboot app protected by Keycloak and it's working fine in localhost,but not working after deploying in kubernates, all the api return 403. And the user has the resource permission when i use envaluate function in keycloak admin console(it definately has since it works well in localhost). When i disable the authorization config(enforcement-mode=disable),all the api return 401. Can anyone give some advice? Thanks in advance!!
The springboot config is like this:
After deploying the app in kubernates, i accessed the pod directly using curl and all the api return 403. The curl result is like this:curl -v --location --request GET 'http://10.42.4.224:80/menu/getRouters' --header 'Authorization: Bearer xxxxxxxx' enter image description here
- I access the api directly with token,but still return 403.
- I disabled the authorization config by setting enforcement-mode=DISABLED,and access the api with token, the api return 401.