OpenLegacyプロジェクトでOAuth2 セキュリティを無効化する方法

OpenLegacyプロジェクトでOAuth2 セキュリティを無効化する方法

手順

  1. pom.xml ファイルへ移動し、以下のセキュリティdepencdencyの削除/コメントを行います:

    <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> <!--Since version 4.6.0 --> <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-security</artifactId> </dependency>
  2. この手順は必須ではありません。

application.yml へ移動し、以下のセキュリティプロパティの削除/コメントを行います:

security: db: init-schema: true clients: - client-id: client_id client-secret: '{noop}client_secret' scope: read,write,trust,ol_admin authorized-grant-types: client_credentials spring: security: oauth2: resourceserver: jwt: jwk-set-uri: http://localhost:8080/.well-known/jwks.json
  1. Swaggerを起動し、認証無しでAPIを実行します。

  1. これで、OpenLegacy APIプロジェクトで、セキュリティを無効にし、レスポンスを得ることができます。