<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><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.&nbsp;</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/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.&nbsp;</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 id="stopSpelling">From: lingvisa@gmail.com<br>Date: Wed, 31 Aug 2016 10:53:20 -0700<br>To: keycloak-user@lists.jboss.org<br>Subject: [keycloak-user] How to integrate or make use of KeyCloak user        database in my own application?<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?&nbsp;</div><div><br></div><div>Thank you.</div><div><br></div><div><br></div><div><br></div></div>
<br>_______________________________________________
keycloak-user mailing list
keycloak-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/keycloak-user</div>                                               </div></body>
</html>