I am using Spring Cloud Gateway and to provide authentication and authorization in my application I am using Keycloak. I have an endpoint which needs to be secured from Keycloak as only the users who has specific role is able to use that endpoint. I created a Role called "A" and assigned that A role to user B. IT works perfect but I do not know how to say that only the rest endpoints who is directed to that link that have A role can accesss this endpoint ? Do you know a way to do it ?
Maybe this question is not fully related with Keycloak. But I want to find out if there is a way to do it or if you have accomplished such kind of issue before ?
Thank you
My Sample Code:
- id: create user
predicates:
- Path=/customer/api/v2/customers/**
- Method=POST
filters:
- StripPrefix=1