Keycloak YB
Keycloak YB
Keycloak YB
org/getting-started/getting-started-zip
Steps:
1. Download Keycloak
$ wget
https://downloads.jboss.org/keycloak/11.0.2/keycloak-11.0.2.zip
$ wget https://jdbc.postgresql.org/download/postgresql-42.2.16.jar
$ mkdir -R
~/keycloak-11.0.2/modules/system/layers/keycloak/org/postgresql/main/
$ cp postgresql-42.2.16.jar
~/keycloak-11.0.2/modules/system/layers/keycloak/org/postgresql/main/
$ vi module.xml
<resources>
<resource-root path="postgresql-42.2.16.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
Declare and Load JDBC driver for mode in which keycloak will be started
Standalone Mode
$ vi keycloak-11.0.2/standalone/configuration/standalone.xml
<subsystem xmlns="urn:jboss:domain:datasources:5.0">
<datasources>
...
<drivers>
<driver name="postgresql" module="org.postgresql">
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-
class>
</driver>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class
>
</driver>
</drivers>
</datasources>
</subsystem>
<!-- <datasource
jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS"
enabled="true" use-java-context="true"
statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfl
y.statistics-enabled:false}}">
<connection-url>jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER
=TRUE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
<pool>
<max-pool-size>100</max-pool-size>
</pool>
</datasource> -->
<datasource
jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS"
enabled="true" use-java-context="true"
statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfl
y.statistics-enabled:false}}">
<connection-url>jdbc:postgresql://127.0.0.1:5433/yugabyte</connection
-url>
<driver>postgresql</driver>
<security>
<user-name>yugabyte</user-name>
<password>password</password>
</security>
<pool>
<max-pool-size>20</max-pool-size>
</pool>
</datasource>
$ bin/standlone.sh