【问题标题】:Keycloak Integration with FlowableKeycloak 与 Flowable 的集成
【发布时间】:2022-07-07 16:55:13
【问题描述】:

我有一个将 Flowable Open Source 作为模块的应用程序。为了在 keycloak 中使用我的角色和用户,flowable IDM 与 keycloak 与此配置集成。

....
flowable:
  common:
    app:
      idm-admin:
        user: <user>
        password: <password>
      security:
        type: oauth2
        o-auth2:
          authorities-attribute: groups
          groups-attribute: ${IAM_USERGROUP:userGroups}
  idm:
    app:
      keycloak:
        enabled: false
        server: ${ISSUER_URL:http://localhost:8080/auth/realms/my-realm}
        authentication-realm: master
        authentication-user: ${IAM_AUTHUSER:admin}
        realm: ${IAM_REALM:my-realm}
        authentication-password: ${IAM_AUTHPASS:admin}
....

现在我的问题是,当我登录主应用程序时,我已经拥有必要的角色,但是当用户尝试使用可流动模块时,它会将用户重定向到登录页面,就好像用户没有经过身份验证或授权一样还没有。

这是我对包含 flowable 的微服务的安全配置

http
                .requestMatchers()
                    .antMatchers("/actuator/**")
                    .and()
                .authorizeRequests()
                    .antMatchers("/actuator/**").permitAll()
                    .and()
                .requestMatchers()
                    .antMatchers("/graphql/**")
                    .and()
                .authorizeRequests()
                    .anyRequest().authenticated()
                    .and()
                    .oauth2Login(oauthLogin -> oauthLogin.permitAll())  //redirect to login if no token or session is provided
                    .oauth2ResourceServer().jwt(); //validate JWT Bearer token

        http.logout()
                .logoutRequestMatcher(new AntPathRequestMatcher("/app/logout"))
                .logoutSuccessHandler(keycloakLogoutHandler);

仅针对安全性定制的执行器和 graphql 端点。所以基本上我将所有身份验证和授权配置留给可流动的类。我在这里做错了什么?

版本 弹簧靴 2.6.2

flowable-spring-boot-starter 6.7.2

【问题讨论】:

    标签: spring-boot spring-security keycloak flowable


    【解决方案1】:

    我认为与我成功配置 flowable / keycloak 集成的方式相比,配置有点偏离。改变这个

    服务器:${ISSUER_URL:http://localhost:8080/auth/realms/my-realm}

    成为

    服务器:http://localhost:8080

    不应与颁发者 url 相同

    【讨论】:

      猜你喜欢
      • 2021-07-26
      • 2019-04-28
      • 2021-12-14
      • 2021-01-10
      • 2020-02-20
      • 2020-05-28
      • 2021-12-02
      • 2023-01-30
      • 2022-07-11
      相关资源
      最近更新 更多