@boxyhq/saml20
Advanced tools
Comparing version 1.4.9 to 1.4.10
@@ -8,3 +8,3 @@ "use strict"; | ||
cert = cert.replace(/\r\n/g, '\n'); | ||
return cert; | ||
return cert.trimEnd(); | ||
}; | ||
@@ -11,0 +11,0 @@ exports.stripCertHeaderAndFooter = stripCertHeaderAndFooter; |
@@ -263,14 +263,16 @@ "use strict"; | ||
'samlp:Response': { | ||
'@xmlns:samlp': 'urn:oasis:names:tc:SAML:2.0:protocol', | ||
'@Version': '2.0', | ||
'@Destination': acsUrl, | ||
'@ID': randomId(), | ||
'@Destination': acsUrl, | ||
'@InResponseTo': requestId, | ||
'@IssueInstant': authTimestamp, | ||
'@Version': '2.0', | ||
'@xmlns:samlp': 'urn:oasis:names:tc:SAML:2.0:protocol', | ||
'@xmlns:xs': 'http://www.w3.org/2001/XMLSchema', | ||
'saml:Issuer': { | ||
'@Format': 'urn:oasis:names:tc:SAML:2.0:nameid-format:entity', | ||
'@xmlns:saml': 'urn:oasis:names:tc:SAML:2.0:assertion', | ||
'@Format': 'urn:oasis:names:tc:SAML:2.0:nameid-format:entity', | ||
'#text': issuer, | ||
}, | ||
'samlp:Status': { | ||
'@xmlns:samlp': 'urn:oasis:names:tc:SAML:2.0:protocol', | ||
'samlp:StatusCode': { | ||
@@ -281,7 +283,10 @@ '@Value': 'urn:oasis:names:tc:SAML:2.0:status:Success', | ||
'saml:Assertion': { | ||
'@xmlns:saml': 'urn:oasis:names:tc:SAML:2.0:assertion', | ||
'@Version': '2.0', | ||
'@ID': randomId(), | ||
'@IssueInstant': authTimestamp, | ||
'@Version': '2.0', | ||
'@xmlns:saml': 'urn:oasis:names:tc:SAML:2.0:assertion', | ||
'@xmlns:xs': 'http://www.w3.org/2001/XMLSchema', | ||
'saml:Issuer': { | ||
'@Format': 'urn:oasis:names:tc:SAML:2.0:nameid-format:entity', | ||
'@xmlns:saml': 'urn:oasis:names:tc:SAML:2.0:assertion', | ||
'#text': issuer, | ||
@@ -298,5 +303,5 @@ }, | ||
'saml:SubjectConfirmationData': { | ||
'@InResponseTo': requestId, | ||
'@NotOnOrAfter': notAfter, | ||
'@Recipient': acsUrl, | ||
'@NotOnOrAfter': notAfter, | ||
'@InResponseTo': requestId, | ||
}, | ||
@@ -308,2 +313,3 @@ }, | ||
'@NotOnOrAfter': notAfter, | ||
'@xmlns:saml': 'urn:oasis:names:tc:SAML:2.0:assertion', | ||
'saml:AudienceRestriction': { | ||
@@ -317,6 +323,7 @@ 'saml:Audience': { | ||
'@AuthnInstant': authTimestamp, | ||
'@SessionIndex': '_YIlFoNFzLMDYxdwf-T_BuimfkGa5qhKg', | ||
'@SessionIndex': requestId, | ||
'@xmlns:saml': 'urn:oasis:names:tc:SAML:2.0:assertion', | ||
'saml:AuthnContext': { | ||
'saml:AuthnContextClassRef': { | ||
'#text': 'urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified', | ||
'#text': 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport', | ||
}, | ||
@@ -326,8 +333,7 @@ }, | ||
'saml:AttributeStatement': { | ||
'@xmlns:xs': 'http://www.w3.org/2001/XMLSchema', | ||
'@xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance', | ||
'@xmlns:saml': 'urn:oasis:names:tc:SAML:2.0:assertion', | ||
'saml:Attribute': Object.keys(claims.raw).map((attributeName) => { | ||
return { | ||
'@Name': attributeName, | ||
'@NameFormat': 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic', | ||
'@NameFormat': 'urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified', | ||
'saml:AttributeValue': { | ||
@@ -346,4 +352,6 @@ '@xmlns:xs': 'http://www.w3.org/2001/XMLSchema', | ||
const xml = xmlbuilder_1.default.create(nodes, { encoding: 'UTF-8' }).end(); | ||
return (0, sign_1.sign)(xml, privateKey, publicKey, '/*[local-name(.)="Response" and namespace-uri(.)="urn:oasis:names:tc:SAML:2.0:protocol"]'); | ||
const signedAssertionXml = (0, sign_1.sign)(xml, privateKey, publicKey, '//*[local-name(.)="Assertion"]'); | ||
const signedXml = (0, sign_1.sign)(signedAssertionXml, privateKey, publicKey, '/*[local-name(.)="Response" and namespace-uri(.)="urn:oasis:names:tc:SAML:2.0:protocol"]'); | ||
return signedXml; | ||
}); | ||
exports.createSAMLResponse = createSAMLResponse; |
{ | ||
"name": "@boxyhq/saml20", | ||
"version": "1.4.9", | ||
"version": "1.4.10", | ||
"description": "SAML 2.0 token parser for Node.js", | ||
@@ -11,3 +11,3 @@ "keywords": [ | ||
"type": "git", | ||
"url": "https://github.com/boxyhq/saml20.git" | ||
"url": "git+ssh://git@github.com/boxyhq/saml20.git" | ||
}, | ||
@@ -55,4 +55,4 @@ "license": "MIT", | ||
"@types/xml2js": "0.4.14", | ||
"@typescript-eslint/eslint-plugin": "6.20.0", | ||
"@typescript-eslint/parser": "6.20.0", | ||
"@typescript-eslint/eslint-plugin": "6.21.0", | ||
"@typescript-eslint/parser": "6.21.0", | ||
"eslint": "8.56.0", | ||
@@ -59,0 +59,0 @@ "eslint-config-prettier": "9.1.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62037
1303