@boxyhq/saml-jackson 0.3.7-beta.696 → 0.3.7-beta.698
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/dist/controller/oauth.js
CHANGED
@@ -135,13 +135,27 @@ class OAuthController {
|
|
135
135
|
code_challenge,
|
136
136
|
code_challenge_method,
|
137
137
|
});
|
138
|
-
|
139
|
-
const
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
138
|
+
const relayState = relayStatePrefix + sessionId;
|
139
|
+
const { sso } = samlConfig.idpMetadata;
|
140
|
+
let redirectUrl = '';
|
141
|
+
let authorizeForm = '';
|
142
|
+
// HTTP Redirect binding
|
143
|
+
if ('redirectUrl' in sso) {
|
144
|
+
const samlReqEnc = yield deflateRawAsync(samlReq.request);
|
145
|
+
redirectUrl = redirect.success(sso.redirectUrl, {
|
146
|
+
RelayState: relayState,
|
147
|
+
SAMLRequest: Buffer.from(samlReqEnc).toString('base64'),
|
148
|
+
});
|
149
|
+
}
|
150
|
+
// HTTP POST binding
|
151
|
+
if ('postUrl' in sso) {
|
152
|
+
const samlReqEnc = Buffer.from(samlReq.request).toString('base64');
|
153
|
+
authorizeForm = (0, utils_1.createAuthorizeForm)(relayState, encodeURI(samlReqEnc), sso.postUrl);
|
154
|
+
}
|
155
|
+
return {
|
156
|
+
redirect_url: redirectUrl,
|
157
|
+
authorize_form: authorizeForm,
|
158
|
+
};
|
145
159
|
});
|
146
160
|
}
|
147
161
|
samlResponse(body) {
|
package/dist/controller/utils.js
CHANGED
@@ -1,8 +1,32 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.IndexNames = void 0;
|
3
|
+
exports.createAuthorizeForm = exports.IndexNames = void 0;
|
4
4
|
var IndexNames;
|
5
5
|
(function (IndexNames) {
|
6
6
|
IndexNames["EntityID"] = "entityID";
|
7
7
|
IndexNames["TenantProduct"] = "tenantProduct";
|
8
8
|
})(IndexNames = exports.IndexNames || (exports.IndexNames = {}));
|
9
|
+
const createAuthorizeForm = (relayState, samlReqEnc, postUrl) => {
|
10
|
+
const formElements = [
|
11
|
+
'<!DOCTYPE html>',
|
12
|
+
'<html>',
|
13
|
+
'<head>',
|
14
|
+
'<meta charset="utf-8">',
|
15
|
+
'<meta http-equiv="x-ua-compatible" content="ie=edge">',
|
16
|
+
'</head>',
|
17
|
+
'<body onload="document.forms[0].submit()">',
|
18
|
+
'<noscript>',
|
19
|
+
'<p>Note: Since your browser does not support JavaScript, you must press the Continue button once to proceed.</p>',
|
20
|
+
'</noscript>',
|
21
|
+
'<form method="post" action="' + encodeURI(postUrl) + '">',
|
22
|
+
'<input type="hidden" name="RelayState" value="' + relayState + '"/>',
|
23
|
+
'<input type="hidden" name="SAMLRequest" value="' + samlReqEnc + '"/>',
|
24
|
+
'<input type="submit" value="Continue" />',
|
25
|
+
'</form>',
|
26
|
+
'<script>document.forms[0].style.display="none";</script>',
|
27
|
+
'</body>',
|
28
|
+
'</html>',
|
29
|
+
];
|
30
|
+
return formElements.join('');
|
31
|
+
};
|
32
|
+
exports.createAuthorizeForm = createAuthorizeForm;
|
package/dist/typings.d.ts
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@boxyhq/saml-jackson",
|
3
|
-
"version": "0.3.7-beta.
|
3
|
+
"version": "0.3.7-beta.698",
|
4
4
|
"description": "SAML 2.0 service",
|
5
5
|
"keywords": [
|
6
6
|
"SAML 2.0"
|
@@ -40,8 +40,6 @@
|
|
40
40
|
"@opentelemetry/api-metrics": "0.27.0",
|
41
41
|
"@peculiar/webcrypto": "1.2.3",
|
42
42
|
"@peculiar/x509": "1.6.1",
|
43
|
-
"cors": "2.8.5",
|
44
|
-
"express": "4.17.2",
|
45
43
|
"mongodb": "4.3.1",
|
46
44
|
"mysql2": "2.3.3",
|
47
45
|
"pg": "8.7.3",
|
@@ -56,7 +54,6 @@
|
|
56
54
|
"xmlbuilder": "15.1.1"
|
57
55
|
},
|
58
56
|
"devDependencies": {
|
59
|
-
"@types/express": "4.17.13",
|
60
57
|
"@types/node": "17.0.17",
|
61
58
|
"@types/sinon": "10.0.11",
|
62
59
|
"@types/tap": "15.0.5",
|