【问题标题】:Invalid JWK Set Object : Spring Boot OAuth无效的 JWK 集对象:Spring Boot OAuth
【发布时间】:2018-09-21 09:42:06
【问题描述】:

收到访问令牌后,我将其附加到我的 Postman 中并测试在 localhost 中运行的示例 REST API(在 Spring Boot 中开发)

这样做时我收到以下错误消息

{
    "error": "server_error",
    "error_description": "Invalid JWK Set Object. The JWK Set MUST have a keys attribute."
}

这是我的 API

@RestController
@RequestMapping("/security/demo")
@EnableResourceServer
public class MyController {

    @GetMapping
    public String sayHello () {
        return "Hello Friend" ;
    }
}

这是我的属性文件

# Security
security.oauth2.resource.id=783f0982-2134-4f98-8a15-c520a6737bbe
security.oauth2.resource.jwk.key-set-uri=https://*******.com/token_key
security.basic.enabled=false

【问题讨论】:

    标签: spring-boot oauth-2.0 spring-oauth2


    【解决方案1】:

    我发现了错误。从我的角度来看,这是一个很大的错误。我不得不设置这个属性来摆脱错误

    security.oauth2.resource.jwt.key-uri
    

    【讨论】:

      猜你喜欢
      • 2020-11-19
      • 2017-11-21
      • 2020-10-30
      • 2018-10-05
      • 1970-01-01
      • 2015-10-16
      • 1970-01-01
      • 2018-12-15
      • 2019-02-18
      相关资源
      最近更新 更多