Sharing KeyCloak SSO session with clients placed inside iframe

575 views
Skip to first unread message

Naresh M

unread,
Jul 27, 2023, 4:38:00 AM7/27/23
to Keycloak User

Hello All,

I have two KeyCloak clients app1, app2 in my realm related to my two web applications http://mysite/app1 and http://mysite/app2.

I want to show app2 inside iframe in app1, but when I login to app1 and redirect to app1 my application app2 does not see SSO session and redirect to KeyCloak login page:

242882301-1dc057ea-8b1e-4884-b322-ff2b0c415b89.png (631×654)

Jon Koops

unread,
Jul 28, 2023, 7:44:34 AM7/28/23
to Naresh M, Keycloak User
I would recommend against this as browsers are actively making it harder to access cookies from iframes to prevent tracking. Not sure what is causing your issue, but likely it's because the iframe is on another domain and some mechanism is preventing access.

--
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/125e01e9-b002-4735-a9b8-7dba8e6acca0n%40googlegroups.com.

Naresh Manthena

unread,
Jul 28, 2023, 9:28:22 AM7/28/23
to Jon Koops, Keycloak User
Hi Jon,

Thanks for your reply.

The domains are different but I want to fix this scenario.
--
Regards,
Naresh Manthena,
M: 9000994443.

Jon Koops

unread,
Jul 28, 2023, 9:31:26 AM7/28/23
to Naresh Manthena, Keycloak User
AFAIK, you can't. Browsers are blocking this, and I don't see that changing.
Reply all
Reply to author
Forward
0 new messages