<div dir="ltr">By management REST API you mean the API the admin console uses? <div><br></div><div>Just to make sure I understand your suggestion correctly:</div><div><br></div><div>* I would use the management REST API (same API the admin console uses) from my backend application<br>
</div><div>* my backend application would need a user (&quot;application user&quot;) within the keycloak-admin realm</div><div>* when accessing the management REST API, I would add an &quot;Authorization: Bearer ...&quot; header with the token I can obtain from .../auth/rest/realms/MY-REALM/tokens/grants/access</div>








<div><br></div><div>Cheers,</div><div>Nils</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 15, 2014 at 3:10 PM, Bill Burke <span dir="ltr">&lt;<a href="mailto:bburke@redhat.com" target="_blank">bburke@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">IMO, you should not use the model directly in your applications.  The<br>
management REST API gives you full access to security metadata.  Use<br>
that.  Plus, in the very near future (after beta-1 release) we&#39;ll be<br>
implementing a cache and if you are modifying data directly, there will<br>
be possibilities of this cache using stale data.<br>
<div class="HOEnZb"><div class="h5"><br>
On 4/15/2014 4:30 AM, Stian Thorgersen wrote:<br>
&gt; At some point we&#39;ll add a Java and REST api&#39;s for user management. This will also include being able to register listeners for user events (for example user created, user deleted, etc).<br>
&gt;<br>
&gt; In the mean time I don&#39;t see any issues with using keycloak-model-jpa directly, especially not for read only. This API will quite likely change between versions, and we won&#39;t support any backwards compatibility. The &quot;official&quot; user management API once it&#39;s ready will be more stable, but I&#39;m not sure when we&#39;ll have time to implement that.<br>

&gt;<br>
&gt; ----- Original Message -----<br>
&gt;&gt; From: &quot;Nils Preusker&quot; &lt;<a href="mailto:n.preusker@gmail.com">n.preusker@gmail.com</a>&gt;<br>
&gt;&gt; To: <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
&gt;&gt; Sent: Tuesday, 15 April, 2014 9:22:44 AM<br>
&gt;&gt; Subject: [keycloak-user] Sharing users<br>
&gt;&gt;<br>
&gt;&gt; Hi, I have a question regarding user management and sharing access to the<br>
&gt;&gt; keycloak database between applications.<br>
&gt;&gt;<br>
&gt;&gt; While the keycloak admin console can be used to manage users, other<br>
&gt;&gt; applications may also need to access the user database. Is there a<br>
&gt;&gt; recommended way of accomplishing this?<br>
&gt;&gt;<br>
&gt;&gt; I&#39;ve been experimenting with adding keycloak-model-jpa to my .war as a<br>
&gt;&gt; dependency and looking at the bootstrapping in<br>
&gt;&gt; org.keycloak.services.resources.KeycloakApplication. However, I wasn&#39;t able<br>
&gt;&gt; to get it to work yet and have the feeling that I might be going the wrong<br>
&gt;&gt; way here.<br>
&gt;&gt;<br>
&gt;&gt; Any hints?<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt; Nils<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; keycloak-user mailing list<br>
&gt;&gt; <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
&gt; _______________________________________________<br>
&gt; keycloak-user mailing list<br>
&gt; <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
&gt;<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<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>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<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>