WSFed server middleware (SAML) for Express.js to generate WS-Federation endpoints. Current stable version: 8.0.0 (released March 2026). Maintained by Auth0, with regular releases. Key differentiators: supports SAML assertions, JWT tokens, encryption, and metadata endpoint generation; designed to work with external user authentication. Alternatives include passport-saml or adal-node for WS-Federation.
npm install wsfedVerified import paths — ran on the pinned version, not inferred.
Sets up Express WSFed middleware for auth and metadata endpoints using PEM keys.
Explicitly set encryptionAlgorithm option to your desired algorithm if needed.
Set disallowEncryptionWithInsecureAlgorithm: false if you must use insecure algorithms (not recommended).
Avoid using these options; ensure proper key sizes and types.
Always call the callback with two arguments: null and the URL string.
Read file contents as UTF-8 or default to string via fs.readFileSync(path, 'utf8').
Install: npm install wsfed. If using CJS, use dynamic import: const wsfed = await import('wsfed');Ensure getPostURL function signature is (wtrealm, wreply, req, callback) and call callback(null, url).
Double-check file paths and use fs.readFileSync with 'utf8' encoding to get PEM string.