【问题标题】:make my jhipster application work with an existing keycloak让我的 jhipster 应用程序与现有的 keycloak 一起工作
【发布时间】:2021-08-15 07:51:29
【问题描述】:

当我想将 jhispter 集成到现有的 keycloak 应用程序时,我遇到了问题。将 jhispter 应用程序与为 keycloak 提供的 docker 映像一起使用,它可以正常工作,但是当我指向另一个 keycloak 应用程序时,它会产生以下错误,我不知道为什么会发生此错误:

org.springframework.beans.factory.UnsatisfiedDependencyException:在 URL [jar:file:/C:/Users/EL/.m2/repository/io/springfox/springfox-spring- 中定义名称为“documentationPluginsBootstrapper”的 bean 创建错误web/3.0.0/springfox-spring-web-3.0.0.jar!/springfox/documentation/spring/web/plugins/DocumentationPluginsBootstrapper.class]:通过构造函数参数1表示的不满足的依赖关系;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException:在 URL [jar:file:/C:/Users/EL/.m2/repository/io/springfox/springfox-spring- 中定义的名称为“webFluxRequestHandlerProvider”的 bean 创建错误webflux/3.0.0/springfox-spring-webflux-3.0.0.jar!/springfox/documentation/spring/web/plugins/WebFluxRequestHandlerProvider.class]:通过构造函数参数1表示的不满足依赖;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException:创建名称为 'org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration$EnableWebFluxConfiguration' 的 bean 时出错:通过方法 'setConfigurers' 参数 0 表达的依赖关系不满足;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException:创建名为 'org.springframework.security.config.annotation.web.reactive.ReactiveOAuth2ClientImportSelector$OAuth2ClientWebFluxSecurityConfiguration' 的 bean 时出错:通过方法 'setClientRegistrationRepository' 参数 0 表达的不满足的依赖关系;嵌套异常是 org.springframework.beans.factory.BeanCreationException:在类路径资源 [org/springframework/boot/autoconfigure/security/oauth2/client/reactive/ReactiveOAuth2ClientConfigurations$ReactiveClientRegistrationRepositoryConfiguration.class] 中定义的名称为“clientRegistrationRepository”的 bean 创建时出错:通过工厂方法实例化 Bean 失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:无法实例化 [org.springframework.security.oauth2.client.registration.InMemoryReactiveClientRegistrationRepository]:工厂方法“clientRegistrationRepository”抛出异常;嵌套异常是 java.lang.IllegalArgumentException: Unable to resolve Configuration with the provided Issuer of "http://localhost:9080/auth/realms/newKeycloak"

提前感谢您的帮助!!

spring.security.oauth2.client.provider.oidc.issuer-uri= http://localhost:9080/auth/realms/myrealm

spring.security.oauth2.client.registration.oidc.client-id= web_app

spring.security.oauth2.client.registration.oidc.client-secret=mysercrtekey

spring.security.oauth2.client.registration.oidc.scope=openid,profile,email

【问题讨论】:

  • 您的应用程序中可能有问题*.yml
  • 文件的配置方式如下: security: oauth2: client: provider: oidc: issuer-uri: localhost:9080/auth/realms/myrealm registration: oidc: client-id: web_app client-secret: 范围:openid,profile,email
  • 请编辑您的问题,而不是将 YAML 放入 cmets(不可读)。在您的错误中,它是 newKeycloak 而不是 myrealm

标签: spring-boot keycloak jhipster


【解决方案1】:

我认为问题可能是不兼容的 keycloak 版本。当我尝试使用版本 12 和 14 的 keycloak 时,一切正常。但是一旦我安装了第 15 版,就没有任何效果了

【讨论】:

    猜你喜欢
    • 2011-04-08
    • 2020-07-07
    • 2021-07-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多