Hi,

regarding multi-tenancy in keycloak, where each tenant maps to a realm, I wanted to ask for help on clarifying some key concepts in keycloak for aid in implementing a simple REST based identity management POC.

Imagine there is a requirement for a multi-tenant environment where user registration (=creation) , user login, user logout and knowing whether a user is still logged in or not must be done over some wrapper REST service which exposes the mentioned functionality to outside world.

With KeyCloak being deployed in a private network, I have written some wrapper REST service which does create users for a desired tenant (=realm), and this wrapper service itself calls KeyCloak's "Direct Grant API" from an OAuth Client with Super-User Credentials both defined in the "master" realm having sufficient privileges over all realms (as defined by the documentation in "Chapter 17. Admin REST API").

Now I want to be able to wrap the logging-in and logging-out process of a user into a tenant in the same way as user creation, which I don't know how to work around this scenario exactly

there are some different questions in my head, regarding the situation explained in my head which I wanted to ask :
Thanks Alot,
I really appreciate your help.