<div dir="ltr">Hi Bill,<div><br></div><div>our use case is as follows: we are developing an application that is deployed as a software as a service solution. Each customer gets their own "application instance", but all instances are served by the same WAR. Since some customers have several instances (i.e. for departments or divisions), it would not be accurate to say customer = realm. So we need another level, which is what I mean when I say tenant. The users would then be sub-elements of the tenants. However, there is one special scenario: some customers wish to have the same users in multiple tenants. </div>
<div><br></div><div>Finally, we want to be able to add customers and instances (or tenants) at runtime.</div><div><br></div><div>Mapped to my sketch from before, customers could be represented by realm (if there is multi-realm support), "application instances" are tenants and users can be created both on realm and on tenant level.</div>
<div><br></div><div>What do you think?</div><div><br></div><div>Cheers,</div><div>Nils</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 30, 2014 at 9:13 PM, Bill Burke <span dir="ltr"><<a href="mailto:bburke@redhat.com" target="_blank">bburke@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Why do you need to add realms at runtime? You haven't adequately<br>
described your use case.<br>
<div class=""><br>
On 5/30/2014 2:12 PM, Nils Preusker wrote:<br>
> Hi Bill,<br>
><br>
</div><div class="">> I guess you are right, there isn't really a difference. It would just be<br>
> important to be able to add realms at runtime. Are you suggesting to<br>
> have nested realms (just replacing tenant with realm in my previous<br>
> example)?<br>
><br>
> Does that make more sense?<br>
> Cheers,<br>
> Nils<br>
><br>
><br>
> On Fri, May 30, 2014 at 6:05 PM, Bill Burke <<a href="mailto:bburke@redhat.com">bburke@redhat.com</a><br>
</div><div><div class="h5">> <mailto:<a href="mailto:bburke@redhat.com">bburke@redhat.com</a>>> wrote:<br>
><br>
> I don't what the different between a tenant and a realm would be in your<br>
> example.<br>
><br>
> On 5/30/2014 5:28 AM, Nils Preusker wrote:<br>
> > Hi Bill,<br>
> ><br>
> > what I was thinking of was tenants as nested element within a realm.<br>
> ><br>
> > We'd like to be able to add tenants at runtime. That's where I see a<br>
> > problem with multi-realm support, since realms are "hardcoded" in the<br>
> > keycloak.json. So if you add a realm in the admin-console, with<br>
> > multi-realm support you'd still have to modify the deployed WAR by<br>
> > adding the new realm to the keycloak.json file.<br>
> ><br>
> > I was thinking of a structure like this:<br>
> ><br>
> > |- realm<br>
> > | |-users<br>
> > | |-realm-level-user-1<br>
> > | |-...<br>
> > |-tenants<br>
> > | |-tenant-1<br>
> > | | |-users<br>
> > | | | |-tenant-level-user-1<br>
> > | | | |-...<br>
> ><br>
> > Let me know what you think!<br>
> > Cheers,<br>
> > Nils<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > On Thu, May 29, 2014 at 11:04 PM, Bill Burke <<a href="mailto:bburke@redhat.com">bburke@redhat.com</a><br>
> <mailto:<a href="mailto:bburke@redhat.com">bburke@redhat.com</a>><br>
</div></div><div><div class="h5">> > <mailto:<a href="mailto:bburke@redhat.com">bburke@redhat.com</a> <mailto:<a href="mailto:bburke@redhat.com">bburke@redhat.com</a>>>> wrote:<br>
> ><br>
> > Somebody else was asking for this feature. We may have to<br>
> add it beta 2<br>
> > even though I wanted to have a feature freeze.<br>
> ><br>
> > How did you expect it to work? One guy wanted to discover<br>
> realm per<br>
> > request via parsing the URL. Another guy just wanted multi-realm<br>
> > support for bearer-only services.<br>
> ><br>
> ><br>
> > On 5/29/2014 4:54 PM, Nils Preusker wrote:<br>
> > > Hi,<br>
> > ><br>
> > > first of all, congrats on the beta 1 release!<br>
> > ><br>
> > > Here's my question: I have a WAR with a REST API that I'm<br>
> > securing with<br>
> > > Keycloak. Now I'd like to add multitenancy support.<br>
> > ><br>
> > > If I understand the concept in keycloak correctly, I would<br>
> > somehow have<br>
> > > to have several realms in the keycloak.json and the web.xml of<br>
> > the war,<br>
> > > right? However there is just one realm-name attribute in the<br>
> > web.xml and<br>
> > > the structure of keycloak.json also looks like it is<br>
> intended for one<br>
> > > realm. Am I missing something?<br>
> > ><br>
> > > Cheers,<br>
> > > Nils<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > > _______________________________________________<br>
> > > keycloak-user mailing list<br>
> > > <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
> <mailto:<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>><br>
</div></div>> <mailto:<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
<div class="">> <mailto:<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" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
> > ><br>
> ><br>
> > --<br>
> > Bill Burke<br>
> > JBoss, a division of Red Hat<br>
> > <a href="http://bill.burkecentral.com" target="_blank">http://bill.burkecentral.com</a><br>
> > _______________________________________________<br>
> > keycloak-user mailing list<br>
> > <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
> <mailto:<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>><br>
</div>> <mailto:<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
<div class="HOEnZb"><div class="h5">> <mailto:<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" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > keycloak-user mailing list<br>
> > <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a> <mailto:<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" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
> ><br>
><br>
> --<br>
> Bill Burke<br>
> JBoss, a division of Red Hat<br>
> <a href="http://bill.burkecentral.com" target="_blank">http://bill.burkecentral.com</a><br>
> _______________________________________________<br>
> keycloak-user mailing list<br>
> <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a> <mailto:<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" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
><br>
><br>
><br>
><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" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
><br>
<br>
--<br>
Bill Burke<br>
JBoss, a division of Red Hat<br>
<a href="http://bill.burkecentral.com" target="_blank">http://bill.burkecentral.com</a><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" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
</div></div></blockquote></div><br></div>