<div dir="ltr">Oh, interesting. I'll look into that.<div><br></div><div>I'll make sure to not include so many users, it's just so I can keep testing keycloak with our application here :)</div><div><br></div><div>
Thank you very much!</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 17, 2014 at 8:33 AM, Stian Thorgersen <span dir="ltr"><<a href="mailto:stian@redhat.com" target="_blank">stian@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Currently we don't support importing users into an existing realm, but you can import a complete realm config including users.<br>
<br>
Have a look at <a href="https://github.com/keycloak/keycloak/blob/master/testsuite/integration/src/test/resources/testrealm.json" target="_blank">https://github.com/keycloak/keycloak/blob/master/testsuite/integration/src/test/resources/testrealm.json</a>. This includes the realm, a few apps/clients, roles, scope mappings, users and user role mappings. You can import this either by running keycloak with -Dkeycloak.import=<path to json file> or through the admin console by selecting add realm and using the upload option.<br>
<br>
It will only work if the realm doesn't already exist, and it's not very efficient at the moment (everything is loaded into memory and written to the db in one transaction).<br>
<div class="im HOEnZb"><br>
----- Original Message -----<br>
> From: "Rodrigo Sasaki" <<a href="mailto:rodrigopsasaki@gmail.com">rodrigopsasaki@gmail.com</a>><br>
</div><div class="HOEnZb"><div class="h5">> To: "Stian Thorgersen" <<a href="mailto:stian@redhat.com">stian@redhat.com</a>><br>
> Cc: "Bill Burke" <<a href="mailto:bburke@redhat.com">bburke@redhat.com</a>>, <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
> Sent: Tuesday, 17 June, 2014 12:23:08 PM<br>
> Subject: Re: [keycloak-user] Roles Integration<br>
><br>
> That would be really awesome, thanks :)<br>
><br>
> But just for now, could you tell me how to do it with the JSON like you<br>
> previously suggested? That way I can import a sample of my users in my dev<br>
> environment so I can keep on testing it out.<br>
><br>
><br>
> On Tue, Jun 17, 2014 at 6:12 AM, Stian Thorgersen <<a href="mailto:stian@redhat.com">stian@redhat.com</a>> wrote:<br>
><br>
> > We're currently working on performance testing and need to investigate how<br>
> > Keycloak handles with large amounts of users. We'll also look at importing<br>
> > such a large amount of users into the db.<br>
> ><br>
> > We'll look at this over the next week and get back to you :)<br>
> ><br>
> > ----- Original Message -----<br>
> > > From: "Rodrigo Sasaki" <<a href="mailto:rodrigopsasaki@gmail.com">rodrigopsasaki@gmail.com</a>><br>
> > > To: "Bill Burke" <<a href="mailto:bburke@redhat.com">bburke@redhat.com</a>><br>
> > > Cc: <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
> > > Sent: Monday, 16 June, 2014 8:21:06 PM<br>
> > > Subject: Re: [keycloak-user] Roles Integration<br>
> > ><br>
> > > Just to be more specific, our mapping here is really simple.<br>
> > ><br>
> > > We have 1 table with the users, one with the roles, and a third one that<br>
> > maps<br>
> > > them both together.<br>
> > ><br>
> > > Thank you for trying to help!<br>
> > ><br>
> > ><br>
> > > On Mon, Jun 16, 2014 at 12:44 PM, Rodrigo Sasaki <<br>
> > <a href="mailto:rodrigopsasaki@gmail.com">rodrigopsasaki@gmail.com</a> ><br>
> > > wrote:<br>
> > ><br>
> > ><br>
> > ><br>
> > > They are all stored in a table on a RDBMS<br>
> > ><br>
> > ><br>
> > > On Mon, Jun 16, 2014 at 12:34 PM, Bill Burke < <a href="mailto:bburke@redhat.com">bburke@redhat.com</a> ><br>
> > wrote:<br>
> > ><br>
> > ><br>
> > > These 20 Million users: Are they stored in a RDBMS? LDAP?<br>
> > ><br>
> > > On 6/16/2014 11:28 AM, Bill Burke wrote:<br>
> > > > Nice! You will be a great reference for us. We'll make it happen.<br>
> > > > Just remind us of this every time we're lax answering your questions :)<br>
> > > ><br>
> > > > On 6/16/2014 10:44 AM, Rodrigo Sasaki wrote:<br>
> > > >> We have about 15 roles and over 20 million users<br>
> > > >><br>
> > > >><br>
> > > >> On Mon, Jun 16, 2014 at 11:32 AM, Stian Thorgersen < <a href="mailto:stian@redhat.com">stian@redhat.com</a><br>
> > > >> <mailto: <a href="mailto:stian@redhat.com">stian@redhat.com</a> >> wrote:<br>
> > > >><br>
> > > >><br>
> > > >><br>
> > > >> ----- Original Message -----<br>
> > > >> > From: "Rodrigo Sasaki" < <a href="mailto:rodrigopsasaki@gmail.com">rodrigopsasaki@gmail.com</a><br>
> > > >> <mailto: <a href="mailto:rodrigopsasaki@gmail.com">rodrigopsasaki@gmail.com</a> >><br>
> > > >> > To: "Stian Thorgersen" < <a href="mailto:stian@redhat.com">stian@redhat.com</a> <mailto: <a href="mailto:stian@redhat.com">stian@redhat.com</a><br>
> > >><br>
> > > >> > Cc: <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>
> > > >> > Sent: Monday, 16 June, 2014 3:27:43 PM<br>
> > > >> > Subject: Re: [keycloak-user] Roles Integration<br>
> > > >> ><br>
> > > >> > That's an interesting suggestion, but how would I do that if the<br>
> > > >> databases<br>
> > > >> > are very different?<br>
> > > >> ><br>
> > > >> > Just remembering that I want to integrate the user role mappings,<br>
> > > >> and not<br>
> > > >> > just the roles themselves.<br>
> > > >><br>
> > > >> Makes sense, roles are not worth much if no users have mappings to<br>
> > > >> them ;)<br>
> > > >><br>
> > > >> ><br>
> > > >> > Should I create a JSON from my database following a specific<br>
> > > >> format to<br>
> > > >> > import it into Keycloak?<br>
> > > >><br>
> > > >> Yes, that's the idea. Roughly how many users and roles do you have?<br>
> > > >><br>
> > > >> ><br>
> > > >> ><br>
> > > >> > On Mon, Jun 16, 2014 at 6:01 AM, Stian Thorgersen<br>
> > > >> < <a href="mailto:stian@redhat.com">stian@redhat.com</a> <mailto: <a href="mailto:stian@redhat.com">stian@redhat.com</a> >> wrote:<br>
> > > >> ><br>
> > > >> > > The only way to do that at the moment would be to import the<br>
> > > >> data into the<br>
> > > >> > > Keycloak database. The easiest way to do this would be to<br>
> > > >> export your<br>
> > > >> > > database to json and import into Keycloak.<br>
> > > >> > ><br>
> > > >> > > If this is something you want to do, let me know and we can<br>
> > > >> give you some<br>
> > > >> > > instructions, maybe also an example, on how to do this.<br>
> > > >> > ><br>
> > > >> > > ----- Original Message -----<br>
> > > >> > > > From: "Rodrigo Sasaki" < <a href="mailto:rodrigopsasaki@gmail.com">rodrigopsasaki@gmail.com</a><br>
> > > >> <mailto: <a href="mailto:rodrigopsasaki@gmail.com">rodrigopsasaki@gmail.com</a> >><br>
> > > >> > > > To: <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>
> > > >> > > > Sent: Friday, 13 June, 2014 3:39:55 PM<br>
> > > >> > > > Subject: [keycloak-user] Roles Integration<br>
> > > >> > > ><br>
> > > >> > > > Hi,<br>
> > > >> > > ><br>
> > > >> > > > I needed to migrate accounts from an old database to<br>
> > > >> authenticate with<br>
> > > >> > > > Keycloak, and I implemented my own provider of the<br>
> > > >> Authentication SPI,<br>
> > > >> > > which<br>
> > > >> > > > worked fine.<br>
> > > >> > > ><br>
> > > >> > > > Now what should I do if I need to migrate the roles from<br>
> > > >> those accounts<br>
> > > >> > > > aswell? Is there a suggested flow that I should follow?<br>
> > > >> > > ><br>
> > > >> > > > Thanks,<br>
> > > >> > > ><br>
> > > >> > > > --<br>
> > > >> > > > Rodrigo Sasaki<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>
> > > >> > > > <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>
> > > >> > Rodrigo Sasaki<br>
> > > >> ><br>
> > > >><br>
> > > >><br>
> > > >><br>
> > > >><br>
> > > >> --<br>
> > > >> Rodrigo Sasaki<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>
> > > --<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>
> > ><br>
> > ><br>
> > ><br>
> > > --<br>
> > > Rodrigo Sasaki<br>
> > ><br>
> > ><br>
> > ><br>
> > > --<br>
> > > Rodrigo Sasaki<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>
><br>
> --<br>
> Rodrigo Sasaki<br>
><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><font face="Times New Roman">Rodrigo Sasaki</font><div></div></div>
</div>