0

In my client configuration in Keycloak I have enabled groups mapping:

enter image description here

enter image description here

and in my Spring Boot application I have a Controller that prints the principal:

@GetMapping("/account/me")
public ResponseEntity<Principal> me(Principal principal) {

    return ResponseEntity.ok(principal);
}

but it doesn't contains the group that I defined in Keycloak.

As mentioned here there should be an additional section other_claims. But it is not added!

Why?

Kambei
  • 458
  • 9
  • 23
  • 1
    Be aware that roles != groups. Have you mapped your groups to realm roles, or did you intend to use a group mapper instead of role mapper? – varesa Jul 29 '21 at 15:42

1 Answers1

2

Your screenshot indicates that you are using a User Realm Role mapper. If you want to map the groups, you need to use a Group Membership mapper instead.

sventorben
  • 1,597
  • 4
  • 17