【问题标题】:Error creating bean with name 'jwtDecoderByJwkKeySetUri' defined in class path resource在类路径资源中定义名称为“jwtDecoderByJwkKeySetUri”的 bean 创建错误
【发布时间】:2021-02-26 19:40:20
【问题描述】:

我在尝试运行 ResourceServer 时遇到此错误,它抱怨:http://localhost:8080/auth/realms/xxxnapp/protocol/openid-connect/certs 因为它没有协议

在创建名称为“jwtDecoderByJwkKeySetUri”的 bean 时出错 类路径资源 [org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerJwtConfiguration$JwtDecoderConfiguration.class]: 通过工厂方法实例化 Bean 失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:失败 实例化 [org.springframework.security.oauth2.jwt.JwtDecoder]: 工厂方法“jwtDecoderByJwkKeySetUri”抛出异常;嵌套的 异常是 java.lang.IllegalArgumentException: Invalid JWK Set URL "= http://localhost:8080/auth/realms/xxxnapp/protocol/openid-connect/certs" :没有协议:= http://localhost:8080/auth/realms/xxxnapp/protocol/openid-connect/certs

知道我是如何克服这个错误的。

【问题讨论】:

  • 您的 URL 开头似乎有一个额外的“=”。您可以将您的 application.properties 文件添加到您的问题中吗?

标签: java spring spring-boot spring-security spring-security-oauth2


【解决方案1】:

propereties 文件中的 url 前有一个额外的“=”,这会导致错误。通过修改它,我的程序正在运行。

【讨论】:

    猜你喜欢
    • 2015-10-16
    • 2019-01-22
    • 2019-08-17
    • 2021-09-20
    • 2019-12-30
    • 2022-01-18
    • 2019-06-16
    相关资源
    最近更新 更多