From 4acea7c2238ec04292e3a8c317e5b71d5d21892b Mon Sep 17 00:00:00 2001 From: Deepak Prabhakara Date: Wed, 27 Apr 2022 21:16:05 +0100 Subject: [PATCH] updated to saml20 v1.0.1 --- package-lock.json | 18 +++++++++--------- package.json | 4 ++-- pages/api/saml/auth.ts | 14 ++++++++++---- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2395e66..4899317 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "mock-saml", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "mock-saml", - "version": "1.0.0", + "version": "1.0.1", "license": "Apache 2.0", "dependencies": { - "@boxyhq/saml20": "1.0.0", + "@boxyhq/saml20": "1.0.1", "next": "12.1.4", "react": "18.0.0", "react-dom": "18.0.0", @@ -123,9 +123,9 @@ } }, "node_modules/@boxyhq/saml20": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@boxyhq/saml20/-/saml20-1.0.0.tgz", - "integrity": "sha512-rX1sYNOffiljgTYW6Pg37cRqBHThnzI28hPY/XTb3QA7l/4z64WmgJVv5+PdJGgc962xF3o7ILknyAcw0b7bFw==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@boxyhq/saml20/-/saml20-1.0.1.tgz", + "integrity": "sha512-afLhTDWE/nhNW9IV1psDoG3c5K1mLPqK0E5f2Db8jJUpos5Yzfi8zE+zjdLxSIJNAbBblG6+GXdGaT/yibCtZQ==", "dependencies": { "@xmldom/xmldom": "0.8.2", "crypto": "1.0.1", @@ -3920,9 +3920,9 @@ } }, "@boxyhq/saml20": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@boxyhq/saml20/-/saml20-1.0.0.tgz", - "integrity": "sha512-rX1sYNOffiljgTYW6Pg37cRqBHThnzI28hPY/XTb3QA7l/4z64WmgJVv5+PdJGgc962xF3o7ILknyAcw0b7bFw==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@boxyhq/saml20/-/saml20-1.0.1.tgz", + "integrity": "sha512-afLhTDWE/nhNW9IV1psDoG3c5K1mLPqK0E5f2Db8jJUpos5Yzfi8zE+zjdLxSIJNAbBblG6+GXdGaT/yibCtZQ==", "requires": { "@xmldom/xmldom": "0.8.2", "crypto": "1.0.1", diff --git a/package.json b/package.json index 7db676f..d1188f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mock-saml", - "version": "1.0.0", + "version": "1.0.1", "description": "Mock SAML is a free SAML 2.0 Identity Provider for testing SAML SSO integrations.", "private": true, "license": "Apache 2.0", @@ -11,7 +11,7 @@ "lint": "next lint" }, "dependencies": { - "@boxyhq/saml20": "1.0.0", + "@boxyhq/saml20": "1.0.1", "next": "12.1.4", "react": "18.0.0", "react-dom": "18.0.0", diff --git a/pages/api/saml/auth.ts b/pages/api/saml/auth.ts index 719e8b2..8b92cf2 100644 --- a/pages/api/saml/auth.ts +++ b/pages/api/saml/auth.ts @@ -33,10 +33,16 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) const xmlSigned = await signResponseXML(xml, config.privateKey, config.publicKey); const encodedSamlResponse = Buffer.from(xmlSigned).toString('base64'); - const html = saml.createPostForm(acsUrl, relayState, { - name: 'SAMLResponse', - value: encodedSamlResponse, - }); + const html = saml.createPostForm(acsUrl, [ + { + name: 'RelayState', + value: relayState, + }, + { + name: 'SAMLResponse', + value: encodedSamlResponse, + }, + ]); res.send(html); } else {