Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@node-saml/passport-saml

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@node-saml/passport-saml

SAML 2.0 authentication strategy for Passport

latest
Source
npmnpm
Version
5.1.0
Version published
Weekly downloads
205K
-1.73%
Maintainers
2
Weekly downloads
 
Created

What is @node-saml/passport-saml?

@node-saml/passport-saml is a SAML 2.0 authentication provider for Passport, the popular Node.js authentication middleware. It allows you to integrate SAML-based Single Sign-On (SSO) into your Node.js applications.

What are @node-saml/passport-saml's main functionalities?

SAML Strategy Configuration

This feature allows you to configure the SAML strategy for Passport. You can specify the SAML endpoint, issuer, and certificate, among other settings.

{"const passport = require('passport');":"","const SamlStrategy = require('@node-saml/passport-saml').Strategy;":"","passport.use(new SamlStrategy({":"","  path: '/login/callback',":"","  entryPoint: 'https://example.com/sso/saml',":"","  issuer: 'passport-saml',":"","  cert: 'MIIC...AB',":"","}, (profile, done) => {":"","  return done(null, profile);":"","}));":""}

User Authentication

This feature demonstrates how to handle the SAML callback route. Upon successful authentication, the user is redirected to the home page.

{"app.post('/login/callback',":"","  passport.authenticate('saml', { failureRedirect: '/', failureFlash: true }),":"","  (req, res) => {":"","    res.redirect('/');":"","  }":"",");":""}

Metadata Generation

This feature allows you to generate and serve the SAML metadata XML, which can be used by the Identity Provider (IdP) to configure the service provider (SP).

{"const samlStrategy = new SamlStrategy({":"","  path: '/login/callback',":"","  entryPoint: 'https://example.com/sso/saml',":"","  issuer: 'passport-saml',":"","  cert: 'MIIC...AB',":"","}, (profile, done) => {":"","  return done(null, profile);":"","});":"","app.get('/metadata', (req, res) => {":"","  res.type('application/xml');":"","  res.send(samlStrategy.generateServiceProviderMetadata());":""}

Other packages similar to @node-saml/passport-saml

Keywords

saml

FAQs

Package last updated on 24 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts