updated to saml20 v1.0.1

This commit is contained in:
Deepak Prabhakara 2022-04-27 21:16:05 +01:00
parent 331c3cf318
commit 4acea7c223
3 changed files with 21 additions and 15 deletions

18
package-lock.json generated
View File

@ -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",

View File

@ -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",

View File

@ -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 {