kiali: Kiali not working with OIDC for 1.19

Describe the bug Configuring OIDC with Kiali configmap , i am not able to login to UI

image

Versions used Kiali: 1.19 Istio: 1.65 Kubernetes flavour and version: (e.g. OpenShift Origin 3.9) - 1.17 EKS

To Reproduce Steps to reproduce the behavior:

  1. Configure Configmap of Kiali to point to dex
auth:
  strategy: openid
  openid:
    client_id: example-app
    issuer_uri: https://dex.xxxx.xxxxx.com/dex
    username_claim: email
    scopes: ["openid", "profile", "email", "groups"]

  1. Create a ClusterRoleBinding to add user to have access to Kiali

  2. Login to Kiali Console and Click on “LogIn with OpenId”

  3. It will throw error as “Unauthorised”

Expected behavior

I should be able to login to the UI console with OIDC

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 53 (16 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @widdix123

I’ve created a PR fixing this issue in #3142. Assuming you still have a cluster with this kube-oidc-proxy setup. Would you help me to try the fix?

I would upload a patched Kiali image to my personal Quay.io account to let you try and confirm that works correctly.

@israel-hdez - It works with Groups as you stated . I have no issue at all with the fix 😃 . Nice work !!!

I will check on X-Forwarded-Port separately .

Hi, I have similar config to what @widdix123 has, but instead of dex I am using keycloak as IdP. I am getting a wrong authorization endpoint after redirect. My config: Version: v1.21.0

auth:
  strategy: openid
  openid:
    client_id: "kubernetes"
    issuer_uri: "https://y.x.x.x.com/auth/realms/master"
    username_claim: "groups"
    insecure_skip_verify_tls: true
    scopes: ["openid", "profile", "email", "groups"]

expected behaviour:

  1. Configure configmap of kiali with above config
  2. Create a ClusterRoleBinding to add group to have access to Kiali
  3. Login to Kiali Console(https://x.x.x.x.x.com) and Click on “LogIn with OpenId”
  4. It should redirect to issue_uri(https://y.x.x.x.com/auth/realms/master) in order to login(as per docs, if authorization_endpoint is not specified, issuer_uri is used, I even tried with authorization_endpoint but got same behaviour)

Actual behaviour At step 4,(instead of redirecting to issuer_uri or authorization_endpoint) it redirects to: “https://x.x.x.x.x.com:20001/kiali/api/auth/openid_redirect

With F12 devloper tools in Chrome, even before clicking on “Log in with OpenId”, I see the wrong authorization_endpoint in Network-> XHR -> preview

authorizationEndpoint: "https://x.x.x.x.x.com:20001/kiali/api/auth/openid_redirect"
sessionInfo: {}
strategy: "openid"

Please consider this scenario as well.