@boxyhq/saml20
Advanced tools
Comparing version 1.1.6 to 1.2.0
@@ -9,2 +9,5 @@ "use strict"; | ||
const nameIdentifierClaimType = 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier'; | ||
const emailAddressClaimType = 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress'; | ||
const givenNameClaimType = 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname'; | ||
const surnameClaimType = 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname'; | ||
function getClaims(attributes) { | ||
@@ -14,4 +17,14 @@ const claims = {}; | ||
const attributeName = attribute['@'].Name; | ||
const friendlyName = attribute['@'].FriendlyName; | ||
const extProp = getExtendedProp(attribute, 'AttributeValue', 'NameID'); | ||
claims[attributeName] = extProp.result; | ||
if (friendlyName === 'email') { | ||
claims[emailAddressClaimType] = extProp.result; | ||
} | ||
else if (friendlyName === 'givenName') { | ||
claims[givenNameClaimType] = extProp.result; | ||
} | ||
else if (friendlyName === 'sn') { | ||
claims[surnameClaimType] = extProp.result; | ||
} | ||
if (extProp.format === permanentNameIdentifier) { | ||
@@ -18,0 +31,0 @@ claims[nameIdentifierClaimType] = extProp.result; |
{ | ||
"name": "@boxyhq/saml20", | ||
"version": "1.1.6", | ||
"version": "1.2.0", | ||
"description": "SAML 2.0 token parser for Node.js", | ||
@@ -44,3 +44,3 @@ "keywords": [ | ||
"xml-encryption": "3.0.2", | ||
"xml2js": "0.5.0", | ||
"xml2js": "0.6.0", | ||
"xmlbuilder": "15.1.1" | ||
@@ -51,6 +51,6 @@ }, | ||
"@types/mocha": "10.0.1", | ||
"@types/node": "20.2.3", | ||
"@types/node": "20.2.5", | ||
"@types/xml2js": "0.4.11", | ||
"@typescript-eslint/eslint-plugin": "5.59.7", | ||
"@typescript-eslint/parser": "5.59.6", | ||
"@typescript-eslint/parser": "5.59.7", | ||
"chai": "4.3.7", | ||
@@ -57,0 +57,0 @@ "eslint": "8.41.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
47509
986
+ Addedxml2js@0.6.0(transitive)
- Removedxml2js@0.5.0(transitive)
Updatedxml2js@0.6.0