kyma-project / busola

Web based Kubernetes Dashboard with a focus on privacy that requires no active components or special privileges in your cluster.
Apache License 2.0
24 stars 48 forks source link

Support newly added kubelogin cli flag `--oidc-use-access-token` #3132

Closed v0lkc closed 3 weeks ago

v0lkc commented 1 month ago

Description

Busola currently does not support the newly added --oidc-use-access-token flag in the kubelogin utility. This flag is essential for enabling authentication using the access_token instead of the id_token. Implementing support for this flag in Busola would allow users to authenticate with XSUAA (SAP BTP) and leverage BTP roles provided in the access token's scope attribute for granting permissions.

Reasons

Attachments

v0lkc commented 4 weeks ago

Busola evaluates the kubelogin arguments at the following location:

https://github.com/kyma-project/busola/blob/773233faf6e0a7a2139c8ce0cab45ce2a5f04fb0/src/components/Clusters/components/oidc-params.ts#L3-L48

To support the --oidc-use-access-token argument, you'll need to add it to the OIDC_PARAM_NAMES map. This update is necessary so that the login logic can determine whether to forward the id_token or the access_token. Three locations require changes for this update:

https://github.com/kyma-project/busola/blob/773233faf6e0a7a2139c8ce0cab45ce2a5f04fb0/src/state/authDataAtom.ts#L69

https://github.com/kyma-project/busola/blob/773233faf6e0a7a2139c8ce0cab45ce2a5f04fb0/src/state/authDataAtom.ts#L87

https://github.com/kyma-project/busola/blob/773233faf6e0a7a2139c8ce0cab45ce2a5f04fb0/src/state/authDataAtom.ts#L101