Is there a way to assign group according registration source

Hi all,

I try to figure out how to, automatically, assign a default group according the user source.
I am using keycloak 22.0

I have two sources of users:

  • users coming from an AD authenticated through an identity provider (google, azure, …)
  • users coming from a self registration process

I want to dispatch the users in two distinct groups according the origin (GROUP_AD or GROUP_SELF_REGISTER). Is it possible to setup such behavior ?

Note:

  1. in the “identity providers” menu, a default provider group is defined via an Identity Provider Hardcoded Mapper
  2. in the “realm settings”, a default group is defined via the “User registration” tab

Thanks for your help

Hello,
Any help or tips should be appreciate.