Spring Security OAuth2 Resource Server 自定义配置

Spring Security OAuth2 Spring Boot About 439 words

添加依赖

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
</dependency>

原始 Spring Boot 自动配置

spring:
  security:
    oauth2:
      resourceserver:
        jwt:
          issuer-uri: http://localhost:8080/realms/my-realm

Java 代码配置

@Bean
JwtDecoder jwtDecoderByIssuerUri() {
    return JwtDecoders.fromIssuerLocation("http://localhost:8080/realms/my-realm");
}
Views: 334 · Posted: 2024-04-30

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh