rootnomad commented on code in PR #14205:
URL: https://github.com/apache/cloudstack/pull/14205#discussion_r4697681811
##########
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:
Fixed in 5cef210abf2. The global generic list is now cached and restored
when the domain is cleared, so the global oidc buttons come 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:
Fixed in 5cef210abf2. The sign in URL is now built with the URL API, so a
provider authorization endpoint that already carries a query string is handled
without a second question mark.
--
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]