I'm securing my REST API using Spring OAuth 2. In there, I have number of clients and under each client there's users. Eg; Client A has users A1 and A2 and client B has users B1 and B2. But I can't find a way to define the relation between clients and users. ( A1 belongs to A not to B etc .. ). I'm using in memory user details service as bellow,
public void globalUserDetails(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication()
.withUser("bill").password("abc123").roles("ADMIN").and()
.withUser("bob").password("abc123").roles("USER");
}
and a custom client details service. Is there a way to define which users are belongs to which client ?