OpenLegacy は、バージョン4.5以降、標準 Spring Security をサポートしています。

ここでは、OAuth2 プロバイダ をJDBC, LDAP または ADで利用するプロパティの設定について説明します:

  1. アプリケーションyamlに、以下を追加します:

spring:
  security:
    oauth2:
      resourceserver:
#  ---EXAMPLE---
        jwt:
          jwk-set-uri: http://localhost:8080/.well-known/jwks.json

JDBCの場合:


JDBC properties

ol:
  security:
    db:
      init-schema: true
      clients:
        - client-id: client_id
          client-secret: '{noop}client_secret'
          scope: read,write,trust,ol_admin
          authorized-grant-types: password       
      # USER CONFIGURATION WORKS ONLY WITH JDBC PROVIDER
      users:
        - username: user
          password: '{noop}password'
  1. デフォルトの pom.xml に、次のdependencyを追加します:

<dependency>
   <groupId>org.openlegacy</groupId>
       <artifactId>openlegacy-security-client-jdbc</artifactId>
       <version>${openlegacy.version}</version>
    </dependency>
    <dependency>
       <groupId>org.openlegacy</groupId>
       <artifactId>openlegacy-security-user-jdbc</artifactId>
       <version>${openlegacy.version}</version>
 </dependency>


LDAPの場合:

  1. 次の dependencyを削除します:

<dependency>
   <groupId>org.openlegacy</groupId>
   <artifactId>openlegacy-security-user-jdbc</artifactId>
   <version>${openlegacy.version}</version>
</dependency>
  1. 代わりに、次の dependency を追加します:

<dependency>
   <groupId>org.openlegacy</groupId>
   <artifactId>openlegacy-security-user-ldap</artifactId>
   <version>${openlegacy.version}</version>
</dependency>

Active Directoryの場合:

  1. 次の dependencyを削除します:

dependency>
   <groupId>org.openlegacy</groupId>
   <artifactId>openlegacy-security-user-jdbc</artifactId>
   <version>${openlegacy.version}</version>
</dependency>
  1. 代わりに、次の dependency を追加します:

<dependency>
   <groupId>org.openlegacy</groupId>
   <artifactId>openlegacy-security-user-active-directory</artifactId>
   <version>${openlegacy.version}</version>
</dependency>