fix: remove double base64 encoding of certificate in SAT auth
The PEM certificate content is already base64 encoded after removing headers and newlines. We should not re-encode it. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,7 +27,8 @@ function buildAuthRequest(credential: Credential): string {
|
|||||||
const uuid = randomUUID();
|
const uuid = randomUUID();
|
||||||
|
|
||||||
const certificate = credential.certificate();
|
const certificate = credential.certificate();
|
||||||
const cerB64 = Buffer.from(certificate.pem().replace(/-----.*-----/g, '').replace(/\n/g, '')).toString('base64');
|
// El PEM ya contiene el certificado en base64, solo quitamos headers y newlines
|
||||||
|
const cerB64 = certificate.pem().replace(/-----.*-----/g, '').replace(/\s/g, '');
|
||||||
|
|
||||||
// Canonicalizar y firmar
|
// Canonicalizar y firmar
|
||||||
const toDigestXml = `<u:Timestamp xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" u:Id="_0">` +
|
const toDigestXml = `<u:Timestamp xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" u:Id="_0">` +
|
||||||
|
|||||||
Reference in New Issue
Block a user