auth0 / node-saml

SAML assertion creation for node
MIT License
69 stars 91 forks source link

The readme example returns undefined #99

Open ajinvise opened 11 months ago

ajinvise commented 11 months ago

Im looking to sign an assertion. Trying out this lib like the readme suggest returns in undefined?

  var saml = require('saml').Saml20; // or Saml11

  var options = {
    cert, // from my X.509 certificate
    key, // from my X.509 certificate
    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);

  console.log(signedAssertion) // undefined (?!)
mpajon commented 11 months ago

Maybe it's because node version. With version 18.0.0 I had the same problem but with 20.8.0 it works

myevit commented 2 months ago

same. tried 18.16.1, 20.15.1, 22.4.1