0
votes

I am currently trying to integrate keycloak with spring cloud dataflow 2.3.0 but the configurations are showing in the documentation is not working for this version. I tried the same with version spring cloud dataflow 2.2.2 and the integrations worked okay. This the config I am added in application.yaml for both the versions,

spring:
  cloud:
    dataflow:
      security:
        authorization:
          map-oauth-scopes: true
security:
  oauth2:
    client:
      client-id: dataflow
     client-secret: 44ed8e53-f52f-4d2e-a205
     access-token-uri: http://localhost:8080/auth/realms/dataflow/protocol/openid-connect/token
     user-authorization-uri: http://localhost:8080/auth/realms/dataflow/protocol/openid-connect/auth
  resource:
    user-info-uri: http://localhost:8080/auth/realms/dataflow/protocol/openid-connect/userinfo
    token-info-uri: http://localhost:8080/auth/realms/dataflow/protocol/openid-connect/token/introspect

I can see the below entries in the 2.2.2 logs after the config is applied but not in 2.3.0

2020-10-18 11:31:40.829  INFO 1 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL95Dialect
2020-10-18 11:31:40.977  INFO 1 --- [           main] org.hibernate.type.BasicTypeRegistry     : HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType@5965844d
2020-10-18 11:31:42.027  INFO 1 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2020-10-18 11:31:43.113  INFO 1 --- [           main] o.s.c.c.s.support.SecurityConfigUtils    : Authorization 'GET' | 'hasRole('ROLE_VIEW')' | '/about'
2020-10-18 11:31:43.114  INFO 1 --- [           main] o.s.c.c.s.support.SecurityConfigUtils    : Authorization 'GET' | 'hasRole('ROLE_VIEW')' | '/audit-records'
2020-10-18 11:31:43.121  INFO 1 --- [           main] o.s.c.c.s.support.SecurityConfigUtils    : Authorization 'GET' | 'hasRole('ROLE_VIEW')' | '/audit-records/**'
2020-10-18 11:31:43.122  INFO 1 --- [           main] o.s.c.c.s.support.SecurityConfigUtils    : Authorization 'GET' | 'hasRole('ROLE_MANAGE')' | '/management/**'
2020-10-18 11:31:43.122  INFO 1 --- [           main] o.s.c.c.s.support.SecurityConfigUtils    : Authorization 'GET' | 'hasRole('ROLE_VIEW')' | '/apps'
2020-10-18 11:31:43.122  INFO 1 --- [           main] o.s.c.c.s.support.SecurityConfigUtils    : Authorization 'GET' | 'hasRole('ROLE_VIEW')' | '/apps/**'
2020-10-18 11:31:43.123  INFO 1 --- [           main] o.s.c.c.s.support.SecurityConfigUtils    : Authorization 'DELETE' | 'hasRole('ROLE_DESTROY')' | '/apps/**'
2020-10-18 11:31:43.123  INFO 1 --- [           main] o.s.c.c.s.support.SecurityConfigUtils    : Authorization 'POST' | 'hasRole('ROLE_CREATE')' | '/apps'
2020-10-18 11:31:43.123  INFO 1 --- [           main] o.s.c.c.s.support.SecurityConfigUtils    : Authorization 'POST' | 'hasRole('ROLE_CREATE')' | '/apps/**'
2020-10-18 11:31:43.124  INFO 1 --- [           main] o.s.c.c.s.support.SecurityConfigUtils    : Authorization 'PUT' | 'hasRole('ROLE_MODIFY')' | '/apps/**'

I have followed the details in here https://docs.spring.io/spring-cloud-dataflow/docs/2.3.0.RELEASE/reference/htmlsingle/#configuration-security-oauth2 and don't understand why it's not working in 2.3.0. Is anyone able to successfully integrate dataflow version 2.3.0 above with keycloak ( not UAA)?. Also, I am using keycloak for SSO and no user registration required.

1

1 Answers

0
votes

The configurations are changed from the version 2.3.0 which is not documented in the dataflow documentations. I have added only the keycloak related configuration in github https://github.com/ChimbuChinnadurai/spring-cloud-dataflow-keycloak-integration