Hello,
so you want to assign client roles from two (multiple) different clients to a user after they self-registered?
As you already mentioned, you can use default roles to do this.
If you are using the old admin console:
1) Goto the "Roles" section of your realm
2) Click default roles tab
3) Use the client roles selector to select the clients you need and assign the roles you want your uses to have
In the new admin-console
1) Realm Settings
2) User Registration
3) Select the client roles you want to have by default
Note that the client roles will be indirectly assigned via the default-roles-$realm role.
I just gave this a spin with Keycloak 19.0.3 and nightly. Works as expected, but I just noticed that the new
keycloak admin console (admin2) does not show the inherited clients roles, but the old admin-console (set admin theme in master realm to "keycloak") does indeed show the client roles.
Cheers,
Thomas