Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cluster-wizard UI & oidc-scopes #3209

Merged
merged 13 commits into from
Aug 27, 2024
5 changes: 5 additions & 0 deletions src/components/Clusters/components/AddClusterWizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ export function AddClusterWizard({ kubeconfig, setKubeconfig, config }) {

const onComplete = () => {
try {
kubeconfig?.users.forEach(user => {
if (!user?.user?.exec?.args?.includes('--oidc-extra-scope=openid')) {
user?.user?.exec?.args?.push('--oidc-extra-scope=openid');
}
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason why you don't want to go this way?

https://github.com/kyma-project/busola/pull/3289/files

Busola is trying to mimic the behavior of the kubelogin command, which does not require openid to be passed as --oidc-extra-scope. Imho you should implement it the same way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Christian, thanks for your review and contribution.
Yes you are correct, I was unaware of your PR, next time you could attach it to the issue to make it more apparent :D
I have a follow-up question to you: should all the defined --oidc-extra-scope be passed along with the openid scope in the scope argument of the UserManager constructor?

Copy link
Contributor Author

@chriskari chriskari Aug 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meaning if you have defined --oidc-extra-scope=scope_a, --oidc-extra-scope=scope_b should the scope passed to the oidc UserManager be scope: "openid scope_a scope_b"?

Copy link
Contributor

@v0lkc v0lkc Aug 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I thought it would be enough to link the fix to the issue. Next time I'll put it right at the beginning of the issue description. Regarding your question: you're right, the scopes have to be passed like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I will incorporate your changes in my PR 👍

setAuth(null);
const contextName = kubeconfig['current-context'];
if (!kubeconfig.contexts?.length) {
Expand Down
Loading