@boxyhq/saml-jackson 0.1.5-beta.91 → 0.1.5-beta.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/saml/saml.js +15 -3
package/package.json
CHANGED
package/src/saml/saml.js
CHANGED
@@ -141,12 +141,20 @@ module.exports = {
|
|
141
141
|
let X509Certificate = null;
|
142
142
|
let ssoPostUrl = null;
|
143
143
|
let ssoRedirectUrl = null;
|
144
|
+
let loginType = 'idp';
|
144
145
|
|
145
|
-
|
146
|
-
|
146
|
+
let ssoDes = rambda.pathOr(
|
147
|
+
null,
|
147
148
|
'EntityDescriptor.IDPSSODescriptor',
|
148
149
|
res
|
149
150
|
);
|
151
|
+
if (!ssoDes) {
|
152
|
+
ssoDes = rambda.pathOr([], 'EntityDescriptor.SPSSODescriptor', res);
|
153
|
+
if (!ssoDes) {
|
154
|
+
loginType = 'sp';
|
155
|
+
}
|
156
|
+
}
|
157
|
+
|
150
158
|
for (const ssoDesRec of ssoDes) {
|
151
159
|
const keyDes = ssoDesRec['KeyDescriptor'];
|
152
160
|
for (const keyDesRec of keyDes) {
|
@@ -157,7 +165,10 @@ module.exports = {
|
|
157
165
|
}
|
158
166
|
}
|
159
167
|
|
160
|
-
const ssoSvc =
|
168
|
+
const ssoSvc =
|
169
|
+
ssoDesRec['SingleSignOnService'] ||
|
170
|
+
ssoDesRec['AssertionConsumerService'] ||
|
171
|
+
[];
|
161
172
|
for (const ssoSvcRec of ssoSvc) {
|
162
173
|
if (
|
163
174
|
rambda.pathOr('', '$.Binding', ssoSvcRec).endsWith('HTTP-POST')
|
@@ -188,6 +199,7 @@ module.exports = {
|
|
188
199
|
if (ssoRedirectUrl) {
|
189
200
|
ret.sso.redirectUrl = ssoRedirectUrl;
|
190
201
|
}
|
202
|
+
ret.loginType = loginType;
|
191
203
|
|
192
204
|
resolve(ret);
|
193
205
|
}
|