Last active
January 25, 2023 23:27
-
-
Save thomasdarimont/7f9fb18c5176f6364fbbb13f5e7cd214 to your computer and use it in GitHub Desktop.
Embedded Keycloak Spring Boot Starter example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring: | |
datasource: | |
username: sa | |
url: jdbc:h2:./data/keycloak;DB_CLOSE_ON_EXIT=FALSE | |
hikari: | |
maximum-pool-size: 25 | |
minimum-idle: 1 | |
server: | |
# forward-headers-strategy: native | |
port: 8080 | |
servlet: | |
context-path: "/" | |
logging: | |
level: | |
org.jgroups: INFO | |
org.infinispan: INFO | |
org.keycloak: INFO | |
org.keycloak.services.managers.DefaultBruteForceProtector: DEBUG | |
org.keycloak.services.scheduled.ClusterAwareScheduledTaskRunner: DEBUG | |
org.keycloak.services.managers.UserSessionManager: DEBUG | |
org.keycloak.timer.basic: DEBUG | |
resteasy: | |
deployment: | |
async_job_service_enabled: true | |
keycloak: | |
custom: | |
server: | |
keycloak-path: "/auth" | |
adminUser: | |
username: admin | |
password: admin | |
create-admin-user-enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demo; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration; | |
@SpringBootApplication(exclude = LiquibaseAutoConfiguration.class) | |
public class KeycloakServerApplication { | |
public static void main(String[] args) { | |
SpringApplication.run(KeycloakServerApplication.class, args); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<parent> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-parent</artifactId> | |
<version>2.4.6</version> | |
<relativePath/> <!-- lookup parent from repository --> | |
</parent> | |
<groupId>io.demo</groupId> | |
<artifactId>keycloak-server</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<name>keycloak-server</name> | |
<description>Demo project for Spring Boot</description> | |
<properties> | |
<java.version>11</java.version> | |
</properties> | |
<dependencies> | |
<dependency> | |
<groupId>com.github.thomasdarimont.embedded-spring-boot-keycloak-server</groupId> | |
<artifactId>embedded-keycloak-server-spring-boot-starter</artifactId> | |
<version>4.0.0</version> | |
</dependency> | |
</dependencies> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-maven-plugin</artifactId> | |
</plugin> | |
</plugins> | |
</build> | |
<repositories> | |
<repository> | |
<id>jitpack.io</id> | |
<url>https://jitpack.io</url> | |
</repository> | |
</repositories> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment