问题是我配置的 Oauth2 资源服务器没有调用 jwk-set-uri 来验证令牌并始终返回 401-未授权响应。我已经配置了一个 Oauth2 资源服务器,如下所示,
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
</dependency>
仅作为依赖项和
春天:安全:oauth2:资源服务器:jwt:jwk-set-uri:http://localhost:8080/well-known/jwks
在 application.yml 文件中。
我很困惑为什么这个设置不起作用。任何输入都受到高度赞赏。