Hi.
I have a short question. Assume the following scenario:
- Newest KeyCloak instance containing realm X
- The realm X contains two clients: A and B (authorization flow setup + password flow for testing purposes)
- Client A has a role “ExampleRole1”,
- Client B has a role “ExampleRole2”,
- The realm X contains user xyz which contains both roles
I’m trying to get a token using password flow:
### Get token
POST http://localhost:8080/realms/X/protocol/openid-connect/token
Content-Type: application/x-www-form-urlencoded
password=foo
&username=xyz
&client_id=A
&grant_type=password
Works fine. However in the token I’m getting roles from client_id A and also B. Why is that so? As I included client_id=A in the request I don’t expect roles from other clients to be returned. Is it possible to set it somehow in the KeyCloak?
Thanks!