<font face="arial" size="2"><p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;">The database would do for a POC im doing right now. Thanks Stian for the information. Thanks a lot for ur prompt response.</p>
<!--WM_COMPOSE_SIGNATURE_START-->
<p style="margin:0;padding:0;">Kalinga</p>
<!--WM_COMPOSE_SIGNATURE_END-->
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;"><br /><br />-----Original Message-----<br />From: "Stian Thorgersen" <stian@redhat.com><br />Sent: Tuesday, April 7, 2015 5:13pm<br />To: "Kalinga Dissanayake" <kalinga@leapset.com><br />Cc: keycloak-user@lists.jboss.org<br />Subject: Re: Externalising session storage in keycloak<br /><br /></p>
<div id="SafeStyles1428408784">
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;">In keycloak-server.json set userSessionProvider to JPA:<br /><br /> "userSessions": {<br /> "provider": "jpa"<br /> }<br /><br />You also need to either disable realm and user caches:<br /><br /> "realmCache": {<br /> "provider": "none"<br /> },<br /><br /> "userCache": {<br /> "provider": "none"<br /> }<br /><br />Or use Infinispan invalidation caches as the clustering documentation suggests.<br /><br />Bear in mind that if you store user sessions in db and don't use the caches you'll be generating a fair bit of db traffic, so it won't scale extremely well.<br /><br /><br />----- Original Message -----<br />> From: "Kalinga Dissanayake" <kalinga@leapset.com><br />> To: "Stian Thorgersen" <stian@redhat.com><br />> Cc: keycloak-user@lists.jboss.org<br />> Sent: Tuesday, 7 April, 2015 1:37:38 PM<br />> Subject: Re: Externalising session storage in keycloak<br />> <br />> <br />> What should I do to store sessions in the database? Is there a guide to do<br />> this? Should I implement any SPI?<br />> <br />> Kalinga<br />> <br />> -----Original Message-----<br />> From: "Stian Thorgersen" <stian@redhat.com><br />> Sent: Tuesday, April 7, 2015 11:50am<br />> To: "Kalinga Dissanayake" <kalinga@leapset.com><br />> Cc: keycloak-user@lists.jboss.org<br />> Subject: Re: Externalising session storage in keycloak<br />> <br />> <br />> <br />> We have support for using either Infinispan or a database (relational or<br />> Mongo) to store the user sessions when load balanced.<br />> <br />> If performance is not a problem you can just go with storing sessions in the<br />> database. Otherwise go with Infinispan, see<br />> http://docs.jboss.org/keycloak/docs/1.2.0.Beta1/userguide/html/clustering.html<br />> for the details on how to configure that. To use a replicated cache instead<br />> of a distributed cache use the following config for Infinspan:<br />> <br />> <subsystem xmlns="urn:jboss:domain:infinispan:2.0"><br />> <cache-container name="keycloak" jndi-name="infinispan/Keycloak"<br />> start="EAGER"><br />> <transport lock-timeout="60000"/><br />> <invalidation-cache name="realms" mode="SYNC"/><br />> <invalidation-cache name="users" mode="SYNC"/><br />> <replicated-cachename="sessions" mode="SYNC"/><br />> <replicated-cache name="loginFailures" mode="SYNC"/><br />> </cache-container><br />> ...<br />> </subsystem><br />> <br />> You can also just use the configuration from the docs above but set<br />> 'owners="2"'.<br />> <br />> ----- Original Message -----<br />> > From: "Kalinga Dissanayake" <kalinga@leapset.com><br />> > To: keycloak-user@lists.jboss.org<br />> > Cc: "Stian Thorgersen" <stian@redhat.com><br />> > Sent: Monday, 6 April, 2015 2:13:42 PM<br />> > Subject: Externalising session storage in keycloak<br />> > <br />> > <br />> > Guys i know this has been discussed before, but im trying to find a simple<br />> > number of steps for me to externalize the session storage in keycloak.<br />> > I just need to do the following;<br />> > 1. Two servers running keycloak (wildfly)<br />> > 2. A load balancer in front of these two servers. Preferably an AWS<br />> > loadbalancer<br />> > 3. I need to store the session details on an external store so that the<br />> > sessions work accurately.<br />> > <br />> > There is so much documentation for this but I am actually confused as to<br />> > what<br />> > i should do and the bare minimum i should do to achieve this. I dont need a<br />> > distributed cache or anything just need one cache store (may be infinispan<br />> > or memcached) and the two keycloak servers running storing the sessions on<br />> > that. Is there one key place i should look into which contains the bare<br />> > minimum i should do.<br />> > <br />> > Kalinga.<br />> ></p>
</div></font>