Damans227 commented on code in PR #14205:
URL: https://github.com/apache/cloudstack/pull/14205#discussion_r4696082515
##########
ui/src/views/auth/Login.vue:
##########
@@ -393,6 +404,7 @@ export default {
getAPI('listOauthProvider', params).then(response => {
if (response) {
const oauthproviders =
response.listoauthproviderresponse.oauthprovider || []
+ this.oauthGenericProviders = oauthproviders.filter(item => item.type
=== 'oidc' && (item.enabled === true || item.enabled === 'true'))
Review Comment:
@rootnomad if someone types a domain and then clears it, do that domain's
oidc buttons stay on the page? looks like the global list never comes back
##########
ui/src/views/auth/Login.vue:
##########
@@ -510,6 +522,26 @@ export default {
this.handleDomain()
this.$store.commit('SET_OAUTH_PROVIDER_USED_TO_LOGIN', 'keycloak')
},
+ loginWithGenericOidc (provider) {
+ this.handleDomain()
+ this.$store.commit('SET_OAUTH_PROVIDER_USED_TO_LOGIN', provider.provider)
+ const discoveryUrl = provider.issuerurl.replace(/\/$/, '') +
'/.well-known/openid-configuration'
+ return fetch(discoveryUrl).then(response => response.json()).then(config
=> {
+ const options = {
+ client_id: provider.clientid,
+ redirect_uri: provider.redirecturi,
+ response_type: 'code',
+ scope: 'openid email',
+ state: this.from || 'cloudstack'
+ }
+ window.location.href = `${config.authorization_endpoint}?${new
URLSearchParams(options).toString()}`
Review Comment:
@rootnomad can we build this link with the URL api? if the provider's sign
in address already has a ? this adds a second one
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]