Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(readme): Document createUnsignedAssertion() and improve usage examples #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

esarafianou
Copy link

Description

  1. saml20.createUnsignedAssertion() and saml11.createUnsignedAssertion() were added in version 0.15 but are not documented in README
  2. All exported functions work with callback, but the usage examples have them as sync functions. This PR fixes this

References

Testing

Only docs changes

@esarafianou esarafianou changed the title docs(readme): Document createUnsignedAssertion() docs(readme): Document createUnsignedAssertion() and improve usage examples May 13, 2021
@@ -23,11 +25,39 @@ var options = {
sessionIndex: '_faed468a-15a0-4668-aed6-3d9c478cc8fa'
};

var signedAssertion = saml.create(options);
saml.create(options, (err, samlAssertion) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Synchronous invocation is actually supported unless the encryptionCert option has been passed in, at which point callback becomes required. It's a bit silly but that's how the library has behaved.

node-saml/lib/saml20.js

Lines 261 to 263 in 06acc02

if (strategies.encryptXml === EncryptXml.unencrypted) {
return strategies.encryptXml(signed, callback);
}

I'm ok with the change though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants