<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
you can take a look at this example :
<a class="moz-txt-link-freetext" href="https://github.com/keycloak/keycloak/tree/master/examples/providers/domain-extension">https://github.com/keycloak/keycloak/tree/master/examples/providers/domain-extension</a><br>
which uses this feature (especially look at the bottom for custom
JPA entities):
<a class="moz-txt-link-freetext" href="https://keycloak.gitbooks.io/server-developer-guide/content/v/2.1/topics/extensions.html">https://keycloak.gitbooks.io/server-developer-guide/content/v/2.1/topics/extensions.html</a><br>
<br>
It allows to extend Keycloak database schema with your own
entities.<br>
<br>
Marek<br>
<br>
On 01/09/16 19:25, Ling wrote:<br>
</div>
<blockquote
cite="mid:CAKUZDO6ZoR1N8okfwzt1tx+XmAA_P2j=DU4mu15zFatBiPibmw@mail.gmail.com"
type="cite">
<div dir="ltr">hi, Christian:
<div><br>
</div>
<div>Are you suggesting using two databases, one is MyKeycloakDS
to store keycloak data, and the other MyApplicationDS to store
my application data? Or you mean just use one database
MyKeycloakDS to store both keycloak user data and my
application data? You said you don't recommend mixing the
keycloak tables with my own, then is it possible to create a
connection between the User_Entity table in KeyCloak database,
and the Post table in my own database? Not an database expert
:)</div>
<div><br>
</div>
<div>Thank you.</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Sep 1, 2016 at 7:33 AM,
Christian Hebert <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:christian_hebert@hotmail.com" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:christian_hebert@hotmail.com">christian_hebert@hotmail.com</a></a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div dir="ltr">
<div>Hi Ling,</div>
<div><br>
</div>
<div>I wouldn't recommend mixing the keycloak tables
with your own but here is how you could do it. First,
you should store the keycloak data in your database
instead of using the default H2 database. We are using
Oracle in our organization. </div>
<div><br>
</div>
<div>To do so, you need to create a new datasource in
your jboss server (I will not cover how to create
this, assuming that you know how) that you will name,
let's say "java:jboss/datasources/<wbr>MyKeycloakDS".</div>
<div><br>
</div>
<div>In your keycloak-server.json file, change the
datasource under "connectionsJpa" for this new
datasource.On the startup, keycloak will create all
the tables required. </div>
<div><br>
</div>
<div>Please note that your current data (realm, users,
roles, ...) will not be there. You will start as a
fresh installation of Keycloak.</div>
<div><br>
</div>
<div>From this point, the table you are looking for is
"USER_ENTITY".</div>
<div><br>
</div>
<div>Hope this can help you!</div>
<div><br>
</div>
<div>Christian</div>
<br>
<div>
<hr>From: <a moz-do-not-send="true"
href="mailto:lingvisa@gmail.com" target="_blank">lingvisa@gmail.com</a><br>
Date: Wed, 31 Aug 2016 10:53:20 -0700<br>
To: <a moz-do-not-send="true"
href="mailto:keycloak-user@lists.jboss.org"
target="_blank">keycloak-user@lists.jboss.org</a><br>
Subject: [keycloak-user] How to integrate or make use
of KeyCloak user database in my own application?
<div>
<div class="h5"><br>
<br>
<div dir="ltr">Hi, All:
<div><br>
</div>
<div>So far I have been playing with KeyCloak
and been able to set it up and running the
customer-portal example successfully. Now I
need to actually use it in my application, and
I am not totally sure whether KeyCloak is the
thing that I am looking for, but I believe my
need is just a common use case and hopefully
KeyCloak is the right software that I am
looking for..</div>
<div><br>
</div>
<div>When a user comes to my website, he
registers and makes a post. Both the post and
the user information is stored into databases,
and the link between the user and post, i.e.
who made which post? So I have two tables in
my database: Post(id, post) and User(id,name),
and another table UserPost(PostID, UserID) to
store linking information. This is all fine in
my own database.</div>
<div><br>
</div>
<div>But now when KeyCloak comes into play, the
user first registers in KeyCloak server and
user information are stored in its own
database there, which seems unrelated to the
database (Post and User) in my application. I
don't want to duplicate two User databases in
two servers, right? Even if I can tolerate the
duplication, how to make the connection
between KeyCloak database and my application
database? I am using JBoss, Hibernate/JPA in
my application.</div>
<div><br>
</div>
<div>Maybe I am missing something in the way how
to connect KeyCloak with my own application.
Is there any tutorial or documentation that I
can read? </div>
<div><br>
</div>
<div>Thank you.</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
</div>
</div>
______________________________<wbr>_________________
keycloak-user mailing list
<a moz-do-not-send="true"
href="mailto:keycloak-user@lists.jboss.org"
target="_blank">keycloak-user@lists.jboss.org</a>
<a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/keycloak-user"
target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/keycloak-user</a></div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
keycloak-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></pre>
</blockquote>
<br>
</body>
</html>