From ab1757d02cefaa50eb67cf056c61d528f2699441 Mon Sep 17 00:00:00 2001 From: sebastienblanc Date: Mon, 22 May 2017 10:54:16 +0200 Subject: [PATCH] reflect usage of the starter --- .../topics/oidc/java/spring-boot-adapter.adoc | 38 +++++++++++++------ .../oidc/java/spring-security-adapter.adoc | 12 ++++++ 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/securing_apps/topics/oidc/java/spring-boot-adapter.adoc b/securing_apps/topics/oidc/java/spring-boot-adapter.adoc index 65c614e3a5..5cab9f260c 100755 --- a/securing_apps/topics/oidc/java/spring-boot-adapter.adoc +++ b/securing_apps/topics/oidc/java/spring-boot-adapter.adoc @@ -7,9 +7,9 @@ You then have to provide some extra configuration via normal Spring Boot configu [[_spring_boot_adapter_installation]] ===== Adapter Installation -The Keycloak Spring Boot adapter takes advantage of Spring Boot's autoconfiguration so all you need to do is add the Keycloak Spring Boot adapter JAR to your project. -Depending on what container you are using with Spring Boot, you also need to add the appropriate Keycloak container adapter. -If you are using Maven, add the following to your pom.xml (using Tomcat as an example): +The Keycloak Spring Boot adapter takes advantage of Spring Boot's autoconfiguration so all you need to do is add the Keycloak Spring Boot starter to your project. +They Keycloak Spring Boot Starter is also directly available from the http://start.spring.io/[Spring Start Page]. +To add it manually and if you are using Maven, add the following to your dependencies : [source,xml,subs="attributes+"] @@ -18,17 +18,33 @@ If you are using Maven, add the following to your pom.xml (using Tomcat as an ex org.keycloak - keycloak-spring-boot-adapter - {{book.project.versionMvn}} - - - org.keycloak - keycloak-tomcat8-adapter - {{book.project.versionMvn}} + keycloak-spring-boot-starter + ---- -Currently the following embedded containers are supported : +Make also sure to add the Adapter BOM dependency : + +[source,xml,subs="attributes+"] +---- + + + + + + org.keycloak.bom + keycloak-adapter-bom + {{book.project.versionMvn}} + pom + import + + + + +---- + + +Currently the following embedded containers are supported and do not require any extra dependencies if using the Starter: * Tomcat * Undertow diff --git a/securing_apps/topics/oidc/java/spring-security-adapter.adoc b/securing_apps/topics/oidc/java/spring-security-adapter.adoc index 30f8157d06..4eb5e2188c 100755 --- a/securing_apps/topics/oidc/java/spring-security-adapter.adoc +++ b/securing_apps/topics/oidc/java/spring-security-adapter.adoc @@ -229,6 +229,18 @@ public class RemoteProductService implements ProductService { The Spring Boot and the Spring Security adapters can be combined. +If you are using the Keycloak Spring Boot Starter to make use of the Spring Security adapter you just need to add the Spring Security starter : + +[source] +---- + + + org.springframework.boot + spring-boot-starter-security + + +---- + ====== Using Spring Boot Configuration By Default, the Spring Security Adapter looks for a `keycloak.json` configuration file. You can make sure it looks at the configuration provided by the Spring Boot Adapter by adding this bean :