Configuration

Resource server configuration

spring:
  security:
    oauth2:
      resourceserver:
        jwt:
          issuer-uri: <authorization-server-base-url>
          jwk-set-uri: <authorization-server-base-url>/protocol/openid-connect/certs
  datasource:
    url: <database-url>
    driverClassName: <driver-class>
    username: admin
    password: <password>
  jpa:
    database-platform: <value>
application:
  allowed-origins: <origins,...>

Security

The Spring Boot application resources are secured using the Keycloak management system. This section summarizes the steps described in this tutorial: setup the resource server.

Keycloak server configuration

  1. Create a client

  2. Create a new role

Dependency

The keycloak-spring-boot-started is a required dependency and should be added to the project pom.xml file.

<dependencies>
    ...
    <dependency>
        <groupId>org.keycloak</groupId>
        <artifactId>keycloak-spring-boot-starter</artifactId>
        <version>11.0.2</version>
    </dependency>
</dependencies>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.keycloak.bom</groupId>
            <artifactId>keycloak-adapter-bom</artifactId>
            <version>11.0.2</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

Project properties

Last updated