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: { actions: {
authenticate() { 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]) set(this, 'errors', [err.message])
}); });
} }

View File

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

View File

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

View File

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