Skip to content

Commit

Permalink
Remove required authEndpoint input
Browse files Browse the repository at this point in the history
  • Loading branch information
jordojordo committed Jun 24, 2024
1 parent d95869d commit 0937ca5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
7 changes: 3 additions & 4 deletions shell/edit/auth/oidc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default {
return !!(clientId && clientSecret && url && realm && isValidScope);
} else {
const { rancherUrl, issuer, authEndpoint } = this.model;
const { rancherUrl, issuer } = this.model;
return !!(clientId && clientSecret && rancherUrl && issuer && isValidScope);
}
Expand Down Expand Up @@ -115,9 +115,9 @@ export default {
},
editConfig(neu, old) {
// Cover use case where user edits existing oidc (oidcUrls aren't persisted, so if we have issuer & authEndpoint set custom endpoints to true)
// Cover use case where user edits existing oidc (oidcUrls aren't persisted, so if we have issuer set custom endpoints to true)
if (!old && neu) {
this.customEndpoint.value = (!this.oidcUrls.url && !this.oidcUrls.authEndpoint) && (!!this.model.issuer && !!this.model.authEndpoint);
this.customEndpoint.value = !this.oidcUrls.url && !!this.model.issuer;
}
}
},
Expand All @@ -131,7 +131,6 @@ export default {
const realmsPath = this.model.id === 'keycloakoidc' ? 'auth/realms' : 'realms';
this.model.issuer = `${ url }/${ realmsPath }/${ this.oidcUrls.realm || '' }`;
this.model.authEndpoint = '';
},
updateScope() {
Expand Down
7 changes: 0 additions & 7 deletions shell/store/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,30 +297,23 @@ export const actions = {
if (!!driver?.actions?.testAndEnable) {
const finalRedirectUrl = returnTo({ config: provider }, this);

console.log('### testAndEnable finalRedirectUrl: ', provider, finalRedirectUrl);

const res = await driver.doAction('testAndEnable', { finalRedirectUrl });

const { idpRedirectUrl } = res;

return openAuthPopup(idpRedirectUrl, provider);
} else {
// github, google, azuread, oidc
console.log('## test body: ', JSON.parse(JSON.stringify(body)));
const res = await driver.doAction('configureTest', body);
const { redirectUrl } = res;

console.log('### test res: ', res);

const url = await dispatch('redirectTo', {
provider,
redirectUrl,
test: true,
redirect: false
});

console.log('### test url', url);

return openAuthPopup(url, provider);
}
} catch (err) {
Expand Down

0 comments on commit 0937ca5

Please sign in to comment.