Skip to content
This repository was archived by the owner on Nov 3, 2026. It is now read-only.
This repository was archived by the owner on Nov 3, 2026. It is now read-only.

The readme example returns undefined #99

Open

Description

@ajinvise

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 (?!)

Activity

  1. mpajon commented on Oct 6, 2023

    @mpajon

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

  2. myevit commented on Jul 16, 2024

    @myevit

    same. tried 18.16.1, 20.15.1, 22.4.1

  3. madaster97 commented on Feb 2, 2025

    @madaster97

    I was seeing the same behavior today (although I was also encrypting my assertions, which the readme example doesn't). I was able to fix it by moving to the callback version of the create call.

      saml.create(options, function(err, assertion) {
        if (err) { console.error(err)}
        else {console.log(assertion)}
      })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions