I am trying to use Keycloak for oauth while setting up Kafka UI and am facing this error: ‘Unable to resolve Configuration with the provided Issuer of “http://localhost:9080/realms/myrealm”’ with respect to issuer URI. Keycloak container is running on 9080 and Kafka UI container on 8080, all specified in my docker compose file.
I hit the endpoint on Keycloak localhost:9080/realms/myrealm/.well-known/openid-configuration to verify the issuer URI and have provided the same endpoint in the config.yml, but according to the logs that URI is not resolving!
docker compose.yml:
version: ‘3.8’
name: “kafbat-ui-keycloak”services:
kafbat-ui:
container_name: kafbat-rbac
image: Package kafka-ui · GitHub
ports:
- 8080:8080
environment:
SPRING_CONFIG_ADDITIONAL-LOCATION: /config.yml
volumes:
- ./config.yml:/config.ymlkeycloak:
image: Quay
ports:
- 9080:8080
- 8082:8443
command: start-dev
environment:
KC_LOG_LEVEL: info
KC_METRICS_ENABLED: true
KC_HEALTH_ENABLED: true
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: adminvolumes: - /keycloak-data:/opt/jboss/keycloak/standalone/data
config.yml
logging:
level:
org.springframework.security: TRACE
io.kafbat.ui.service.rbac: TRACEdynamic.config.enabled: true
auth:
type: OAUTH2
oauth2:
client:
keycloak:
clientId: kafbat-ui-client
clientSecret: redacted
scope: openid,roles
client-name: keycloak
provider: keycloak
redirect-uri: http://localhost:8080/login/oauth2/code/keycloak
authorization-grant-type: authorization_code
issuer-uri: http://localhost:9080/realms/myrealm
user-name-attribute: name
custom-params:
type: oauth
roles-field: groupsrbac:
roles:
- name: “admins”
clusters:
- local
subjects:
- provider: oauth
type: role
value: “Admin”permissions: - resource: applicationconfig actions: all - resource: clusterconfig actions: all - resource: topic value: ".*" actions: all - resource: consumer value: ".*" actions: all - resource: schema value: ".*" actions: all - resource: connect value: ".*" actions: all - resource: ksql actions: all - resource: acl actions: all - resource: audit actions: all - name: "readonly" clusters: - local subjects: - provider: oauth type: role value: "Viewer" permissions: - resource: clusterconfig actions: [ "view" ] - resource: topic value: ".*" actions: - VIEW - MESSAGES_READ - resource: consumer value: ".*" actions: [ view ] - resource: schema value: ".*" actions: [ view ] - resource: connect value: ".*" actions: [ view ] - resource: acl actions: [ view ]