Fix the signing -wip
This commit is contained in:
parent
b53c3b41b7
commit
631a3b6884
@ -42,8 +42,7 @@ export default async function handler(
|
|||||||
const signingKey = await fetchPrivateKey();
|
const signingKey = await fetchPrivateKey();
|
||||||
const publicKey = await fetchPublicKey();
|
const publicKey = await fetchPublicKey();
|
||||||
const xmlSigned = await signResponseXML(xml, signingKey, publicKey);
|
const xmlSigned = await signResponseXML(xml, signingKey, publicKey);
|
||||||
|
const encodedSamlResponse = Buffer.from(xmlSigned).toString('base64');
|
||||||
const encodedSamlResponse = Buffer.from(xmlSigned).toString('base64');
|
|
||||||
|
|
||||||
const html = createResponseForm(relayState, encodedSamlResponse, acsUrl);
|
const html = createResponseForm(relayState, encodedSamlResponse, acsUrl);
|
||||||
|
|
||||||
|
|||||||
@ -147,9 +147,6 @@ const signResponseXML = async (xml: string, signingKey: any, publicKey: any): Pr
|
|||||||
const responseXPath = '/*[local-name(.)="Response" and namespace-uri(.)="urn:oasis:names:tc:SAML:2.0:protocol"]';
|
const responseXPath = '/*[local-name(.)="Response" and namespace-uri(.)="urn:oasis:names:tc:SAML:2.0:protocol"]';
|
||||||
const issuerXPath = '/*[local-name(.)="Issuer" and namespace-uri(.)="urn:oasis:names:tc:SAML:2.0:assertion"]';
|
const issuerXPath = '/*[local-name(.)="Issuer" and namespace-uri(.)="urn:oasis:names:tc:SAML:2.0:assertion"]';
|
||||||
|
|
||||||
publicKey = publicKey.replace(/\\n/gm, '\n');
|
|
||||||
signingKey = signingKey.replace(/\\n/gm, '\n');
|
|
||||||
|
|
||||||
console.log({publicKey, signingKey})
|
console.log({publicKey, signingKey})
|
||||||
|
|
||||||
sig.signatureAlgorithm = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256';
|
sig.signatureAlgorithm = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user