Allowing login for multiple clients from one realm in KeyCloak

1,542 views
Skip to first unread message

Hans

unread,
Aug 19, 2022, 2:02:07 AM8/19/22
to Keycloak User

I'm using React.js + keycloak to implement the SSO in my project and currently I'm using one client from one realm. I wonder that can we allow multiple clients login in one realm in key-cloaks from same login keycloak page?

To be more clear, For example, I have one realm called testRealm and it has two clients called testClient1, testClient2 and lastly user t1 has role called tester in testClient1 and user t2 has role called viewer in testClient2. In key-cloak login page, I want to user get their corresponding roles from different clients after login in react.

My current Keyclaok keycloakAuth instance

const keycloakAuth = new Keycloak({ url: url, realm: "testRealm", clientId: "testClient1", });

My Ideal Keyclaok keycloakAuth instance I would like to support one more realm called testClient2. How can we achieve this in react?

Paul Robert Marino

unread,
Aug 19, 2022, 3:44:32 AM8/19/22
to Hans, Keycloak User
Well I'm thinking about doing something somewhat similar and what I
was thinking is writing a custom login page thet prompt the user fo
their email address first to determine if they are doing a login via a
3rd party IDP (SAML or OpenID ) or local login and then either
prompting them for their password and MFA (for local login) or sending
them to the edirect for their IDP.
this should all be doable via the rest API
> --
> You received this message because you are subscribed to the Google Groups "Keycloak User" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to keycloak-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/keycloak-user/3f2c2afa-d500-47f9-8297-54f10deec8f5n%40googlegroups.com.

주성재

unread,
Aug 19, 2022, 4:01:49 AM8/19/22
to Keycloak User
Sorry my typo, should be one more client instead of realm.
I would like to support one more realm Client called testClient2. How can we achieve this in react?

2022년 8월 19일 (금) 오후 2:02, Hans <hohun...@gmail.com>님이 작성:
--
Reply all
Reply to author
Forward
0 new messages