package
Create SAML assertions. Supports SAML 1.1 and SAML 2.0 tokens.
npm install samlGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Create SAML assertions. Supports SAML 1.1 and SAML 2.0 tokens.
node >= 12
var saml = require('saml').Saml20; // or Saml11
var options = {
cert: fs.readFileSync(__dirname + '/test-auth0.pem'),
key: fs.readFileSync(__dirname + '/test-auth0.key'),
issuer: 'urn:issuer',
lifetimeInSeconds: 600,
audiences: 'urn:myapp',
attributes: {
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress': 'foo@bar.com',
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name': 'Foo Bar'
},
nameIdentifier: 'foo',
sessionIndex: '_faed468a-15a0-4668-aed6-3d9c478cc8fa'
};
var signedAssertion = saml.create(options);Everything except the cert and key is optional.
SAML assertions can optionally be encrypted, by providing a certificate and public key, as follows:
var saml = require('saml').Saml20; // or Saml11
var options = {
cert: fs.readFileSync(__dirname + '/test-auth0.pem'),
key: fs.readFileSync(__dirname + '/test-auth0.key'),
nameIdentifier: 'foo',
encryptionPublicKey: fs.readFileSync(__dirname + '/encryption-key.pub'),
encryptionCert: fs.readFileSync(__dirname + '/encryption-cert.pem'),
encryptionAlgorithm: 'http://www.w3.org/2001/04/xmlenc#aes256-cbc', // Defaults to http://www.w3.org/2009/xmlenc11#aes256-gcm if not specified
disallowEncryptionWithInsecureAlgorithm: true,
warnOnInsecureEncryptionAlgorithm: true
}See node-xml-encryption for documentation on the allowed algorithms. If using algorithms treated as insecure by node-xml-encryption, you must provide disallowEncryptionWithInsecureAlgorithm option set to false.
A warning will be piped to stderr using console.warn() by default when the insecure algorithms are used and above mentioned flag is false. This can be disabled via the warnOnInsecureEncryptionAlgorithm flag.
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
This project is licensed under the MIT license. See the LICENSE file for more info.
auth0npm
devops+npm@auth0.com
oktajeffoktajeff
jeff.shuman@okta.com
bsmith-auth0
brian.s.smith@okta.com
sanjay.manikandhan
sanjay.manikandhan@okta.com
nirjo
nirmal.joishi@okta.com
niltorresatko
nil.torres@okta.com
jaskirat_atko
jaskirat.singh@okta.com
henry.mcardle
henry.mcardle@okta.com
nicolas.villalobos
nicolas.villalobos@okta.com
choah
choah.jung@auth0.com
josecarlos-chavez_atko
josecarlos.chavez@okta.com
skatko
saurabh.kumar@okta.com
tj.okta
tirone.pama@auth0.com
sgarcia-atko
sergio.garciaramos@okta.com
roger.chan
roger.chan@auth0.com
maaantone
michael.antone@auth0.com
lewisbyrne-okta
lewis.byrne@okta.com
tarunpreet.kaur
tarunpreet.kaur@okta.com
Estimated unpacked size across 11 packages.
6.2 MB
Includes dependencies.
8 direct · 5 outdated
^3.2.4
3.2.6
0.0.5
0.0.36
^2.29.4
2.31.0
~1.0.9
1.0.9
^2.1.3
6.4.0
5.0.0