<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 8.5.2015 17:16, Anton Hughes wrote:<br>
    </div>
    <blockquote
cite="mid:CAMOUzMC3_8CoSpuY0sRu2mVh6H2=_SnV8BPTw+TKySMD6BPt6A@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">Thanks Stian<br>
          <div class="gmail_quote">On Fri, May 8, 2015 at 7:17 AM, Stian
            Thorgersen <span dir="ltr">&lt;<a moz-do-not-send="true"
                href="mailto:stian@redhat.com" target="_blank">stian@redhat.com</a>&gt;</span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
              </span>Yes, you've got two options atm:<br>
              <br>
              * Export your users to a json file and import into
              Keycloak - in the future we want to be able to import
              users into existing realm, but currently you have to
              create a new realm<br>
            </blockquote>
            <div>Its no problem creating a realm. Is there an example of
              importing users from a json file? Or can you point me to
              documentation for this? <br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    You can see some documentation for export/import here
    <a class="moz-txt-link-freetext" href="http://docs.jboss.org/keycloak/docs/1.2.0.CR1/userguide/html/export-import.html">http://docs.jboss.org/keycloak/docs/1.2.0.CR1/userguide/html/export-import.html</a>
    . You can first try to create some example realm with few users,
    then export it and then re-import it to see how it works and what is
    the format of the file.<br>
    <br>
    However the tricky part for migrating users from external system to
    Keycloak DB are user passwords. You will be able to import user
    passwords to Keycloak DB just if you know them in plain-text or if
    you use PBKDF2 for store them in your current DB like we are using
    in Keycloak. In this case you will need to add hash + salt + number
    of iterations (you will need to know these from your DB) for each
    user password similarly like you can see in the file previously
    exported from Keycloak DB. <br>
    <br>
    That's why using federation and implement your FederationProvider
    might be better approach.<br>
    <br>
    Marek<br>
    <blockquote
cite="mid:CAMOUzMC3_8CoSpuY0sRu2mVh6H2=_SnV8BPTw+TKySMD6BPt6A@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              * Use the admin rest api (or java admin client) to import
              users</blockquote>
          </div>
          Thanks again<br>
          <br>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          <div>
            <div dir="ltr">
              <div>
                <div dir="ltr"><b>
                    <p dir="ltr"
style="font-weight:normal;line-height:1.15;margin-top:0pt;margin-bottom:0pt"><br>
                    </p>
                    <b style="font-weight:normal"><span
style="font-size:11px;font-family:Arial;color:rgb(0,102,153);vertical-align:baseline;white-space:pre-wrap"></span><br>
                      <span
style="font-size:11px;font-family:Arial;color:rgb(0,102,153);vertical-align:baseline;white-space:pre-wrap"></span><br>
                      <span
style="font-size:11px;font-family:Arial;color:rgb(0,102,153);vertical-align:baseline;white-space:pre-wrap"></span></b><b
                      style="font-weight:normal"><span
style="font-size:11px;font-family:Arial;color:rgb(0,102,153);vertical-align:baseline;white-space:pre-wrap"></span></b></b></div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>