Merge pull request #4020 from codyrancher/saml-socket

Updating SAML logins to include a socketId
This commit is contained in:
Westly Wright 2020-05-28 13:42:38 -07:00 committed by GitHub
commit 86882b5390
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 4 deletions

View File

@ -9,7 +9,7 @@ export default Component.extend({
actions: {
authenticate() {
get(this, 'saml').login(get(this, 'provider')).catch( ( err ) => {
get(this, 'saml').login(get(this, 'provider'), get(this, 'socketId')).catch( ( err ) => {
set(this, 'errors', [err.message])
});
}

View File

@ -22,7 +22,7 @@ export default Controller.extend({
router: service(),
session: service(),
queryParams: ['errorMsg', 'resetPassword', 'errorCode'],
queryParams: ['errorMsg', 'resetPassword', 'errorCode', 'socketId'],
waiting: false,
adWaiting: false,
localWaiting: false,

View File

@ -39,6 +39,7 @@
{{login-saml
action=(action "started")
provider="shibboleth"
socketId=socketId
}}
{{/if}}
@ -77,6 +78,7 @@
{{login-saml
action=(action "started")
provider="ping"
socketId=socketId
}}
{{/if}}
@ -84,6 +86,7 @@
{{login-saml
action=(action "started")
provider="adfs"
socketId=socketId
}}
{{/if}}
@ -91,6 +94,7 @@
{{login-saml
action=(action "started")
provider="okta"
socketId=socketId
}}
{{/if}}
@ -98,6 +102,7 @@
{{login-saml
action=(action "started")
provider="keycloak"
socketId=socketId
}}
{{/if}}
{{/if}}

View File

@ -9,11 +9,15 @@ export default Service.extend({
app: service(),
intl: service(),
login(providerName) {
login(providerName, socketId) {
const finalUrl = window.location.origin;
const provider = get(this, 'access.providers').findBy('id', providerName);
const args = {
finalRedirectUrl: finalUrl,
socketId
};
return provider.doAction('login', { finalRedirectUrl: finalUrl }).then( ( resp ) => {
return provider.doAction('login', args).then( ( resp ) => {
return window.location.href = resp.idpRedirectUrl;
}).catch(() => {
return {