您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

无法使用KeycloakAutoConfiguration使用Spring Boot Security UnsatisfiedDependencyException设置Keycloak

无法使用KeycloakAutoConfiguration使用Spring Boot Security UnsatisfiedDependencyException设置Keycloak

确保在build.gradle或pom.xml中具有以下依赖项

"org.springframework.boot:spring-boot-starter-web",
            "org.springframework.boot:spring-boot-starter-security",
            "org.springframework.security:spring-security-oauth2-jose",
            "org.springframework.security.oauth:spring-security-oauth2:2.3.4.RELEASE",
            "org.springframework.security:spring-security-oauth2-resource-server"

application.yaml

spring:
  application:
    name: sociter
  security:
    oauth2:
      resourceserver:
        jwt:
          jwk-set-uri: http://localhost:8080/auth/realms/{REALM_NAME}/protocol/openid-connect/certs
          issuer-uri: http://localhost:8080/auth/realms/{REALM_NAME}

并按如下所示设置网络安全性:

https://github.com/jzheaux/messaging-app/blob/master/resource- server/src/main/java/sample/config/ResourceServerConfig.java

更多详细信息:https ://spring.io/blog/2018/08/21/spring- security-5-1-0-rc1-released#oauth2-resource- server

Java 2022/1/1 18:18:30 有605人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶