Spring OAuth2.0: Getting User Roles based on Client Id
I have multiple clients registered for my oauth2 auth server. lets say user1 have roles such as ROLE_A , ROLE_B for client1 , same user has roes such as ROLE_C , ROLE_D for client2 . now when the user logins either using client1 or client2 he is able to see all the four roles ie. ROLE_A , ROLE_B , ROLE_C and ROLE_D . My requirement was when the user1 logins to client1 it should return only the roles ROLE_A and ROLE_B . when he logins using client2 it should return only ROLE_C and ROLE_D For achieving this, what I planned is within the authenticate function, I need to get the clientId. so using