<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div>Assume these are the users in each realm:</div>
<div><br>
</div>
<div>realm1 : [ “jaxley”, “nancy” ]</div>
<div>realm2 : [ “LDAP:foouser@example.org”, “SAML:baruser@example.org&quot; ]</div>
<div>&nbsp;&nbsp;</div>
<div>
<div id="MAC_OUTLOOK_SIGNATURE"></div>
</div>
</div>
<div>If realm1 configuration == &quot;Authenticate against realm2 with fallback to local realm (realm1)”</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>AND A User tries to log in, then authenticate the user against realm2 first (internally); if the user is not found or fails, try against the local realm realm1. &nbsp;If that succeeds, that is the
 user and they are now authenticated.</div>
<div><br>
</div>
<div>Thus, if foouser@example.org tried to log into realm1, they would be tried in realm2 first (their home realm).</div>
<div>But if “jaxley” tried to log into realm1, an attempt would be made against realm2 and fail (no “jaxley” there), then an attempt against realm1 would be made. &nbsp;If that succeeds, that is the user and they are now authenticated.</div>
<div><br>
</div>
<div>What I want to be able to do is to maintain a set of users inside a Keycloak realm, but I want to still be able to create multiple additional realms to represent different configurations (e.g. Internal-facing vs. external-facing). &nbsp;The challenge is how
 when applications use those additional realms to authenticate can we seamlessly allow authentication in our preferred order of searching. &nbsp;I’d hate to have the official answer to be to use the APIs to write a login UI ourselves…</div>
<div><br>
</div>
<div>This kind of “preferred order of authentication sources” capability as a declarative configuration option is a feature of many commercial IdM and authentication tools. &nbsp;The conflict between users with the same login ID across realms is either resolved
 by fully qualifying the user IDs or using the search order to make some sources weighted higher in the search path so those win.</div>
<div><br>
</div>
<div>-Jason</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:12pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Stian Thorgersen &lt;<a href="mailto:sthorger@redhat.com">sthorger@redhat.com</a>&gt;<br>
<span style="font-weight:bold">Reply-To: </span>&quot;<a href="mailto:stian@redhat.com">stian@redhat.com</a>&quot; &lt;<a href="mailto:stian@redhat.com">stian@redhat.com</a>&gt;<br>
<span style="font-weight:bold">Date: </span>Thursday, April 7, 2016 at 10:05 PM<br>
<span style="font-weight:bold">To: </span>Jason Axley &lt;<a href="mailto:jaxley@expedia.com">jaxley@expedia.com</a>&gt;<br>
<span style="font-weight:bold">Cc: </span>Marek Posolda &lt;<a href="mailto:mposolda@redhat.com">mposolda@redhat.com</a>&gt;, Sarp Kaya &lt;<a href="mailto:akaya@expedia.com">akaya@expedia.com</a>&gt;, &quot;<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>&quot;
 &lt;<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>&gt;<br>
<span style="font-weight:bold">Subject: </span>Re: [keycloak-user] SSO amongst two realms<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">Can you elaborate on how you imagine &quot;fallback to the local realm&quot; would work?</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 7 April 2016 at 21:59, Jason Axley <span dir="ltr">&lt;<a href="mailto:jaxley@expedia.com" target="_blank">jaxley@expedia.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>
<div>
<div>Could you possibly support “Authenticate by default” with a “fallback to the local realm”?&nbsp; It would be nice to have certain users attached to a particular realm realm1 but have Keycloak internally attempt to authenticate first against another realm so
 you can get the effect of a union of the users across the two realms.&nbsp; The user experience with the federation buttons as an alternative makes this configuration complexity exposed to the user and I’d prefer to not have to do that.</div>
<div><br>
</div>
<div>-Jason</div>
<div>
<div></div>
</div>
</div>
</div>
<div><br>
</div>
<span>
<div style="font-family:Calibri;font-size:12pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt">
<span style="font-weight:bold">From: </span>&lt;<a href="mailto:keycloak-user-bounces@lists.jboss.org" target="_blank">keycloak-user-bounces@lists.jboss.org</a>&gt; on behalf of Marek Posolda &lt;<a href="mailto:mposolda@redhat.com" target="_blank">mposolda@redhat.com</a>&gt;<br>
<span style="font-weight:bold">Date: </span>Wednesday, February 24, 2016 at 11:25 PM<br>
<span style="font-weight:bold">To: </span>Sarp Kaya &lt;<a href="mailto:akaya@expedia.com" target="_blank">akaya@expedia.com</a>&gt;, &quot;<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a>&quot; &lt;<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a>&gt;<br>
<span style="font-weight:bold">Subject: </span>Re: [keycloak-user] SSO amongst two realms<br>
</div>
<div>
<div class="h5">
<div><br>
</div>
<div>
<div bgcolor="#FFFFFF" text="#000000">
<div>It's possible to achieve something like this with identity provider. You can create identityProvider in realm2, which will authenticate against realm1. In that case, there will be button in login screen of realm2 like &quot;Login with realm1&quot; and when user
 clicks on this, he will be logged-in automatically. There is also possibility to use switch &quot;Authenticate by default&quot; in identity provider and then login screen of realm2 won't be shown, but instead it will always automatically redirect to realm1 login screen.<br>
<br>
The thing is, that you will end with duplicated user accounts (Account of user &quot;john&quot; will be in both realm1 and realm2). AFAIK we plan to improve this in the future to have this use-case more &quot;friendly&quot; as more people ask about that.<br>
<br>
Marek <br>
<br>
On 25/02/16 01:39, Sarp Kaya wrote:<br>
</div>
<blockquote type="cite">
<div>Hi,</div>
<div><br>
</div>
<div>I want to know whether it is possible to have SSO amongst two realms. Ie User 1 logins to an app1 that auths against realm1, then user 1 tries to use app2 which auths against realm2 which should work fine as user 1 logged into realm1 before and it should
 SSO into app2 fine.</div>
<div><br>
</div>
<div>If this is possible then what would be the setup like?</div>
<div><br>
</div>
<div>Kind Regards,</div>
<div>Sarp</div>
<br>
<fieldset></fieldset> <br>
<pre>_______________________________________________
keycloak-user mailing list
<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a><a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></pre>
</blockquote>
<br>
</div>
</div>
</div>
</div>
</span></div>
<br>
_______________________________________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</span>
</body>
</html>