New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@node-saml/passport-saml

Package Overview
Dependencies
Maintainers
2
Versions
10
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

5.0.0
latest
Source
npm
Version published
Weekly downloads
200K
7.99%
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 27 Mar 2024

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