Fix the signing -wip
This commit is contained in:
parent
b53c3b41b7
commit
631a3b6884
@ -42,7 +42,6 @@ export default async function handler(
|
||||
const signingKey = await fetchPrivateKey();
|
||||
const publicKey = await fetchPublicKey();
|
||||
const xmlSigned = await signResponseXML(xml, signingKey, publicKey);
|
||||
|
||||
const encodedSamlResponse = Buffer.from(xmlSigned).toString('base64');
|
||||
|
||||
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 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})
|
||||
|
||||
sig.signatureAlgorithm = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user