SAML
This a node.js saml library.
Currently, the library just for SAML 2.0 and SP(Service Provider).
Install
npm install samljs --save
Usage
Use this library to generate SAMLRequest and parse SAMLResponse
SAMLRequest
To generate a SAML AuthNRequest:
const saml = ;const AuthnRequest = samlAuthnRequest; const opts = issuer: 'https://sp.example.com' acs: 'https://sp.example.com/sso/callback' ssoService: 'https://idp.example.com/login/sso';const authnReq = opts;// generate base64 encoded SAMLRequestvar samlRequest1 = authnReq;// generate compressed base64 encoded SAMLRequestvar samlRequest2 = authnReq;
SAMLResponse
To parse a SAMLResponse
const saml = ; // the SAMLResponse body from HTTP Request body, such as express's req.bodyconst body = reqbodySAMLResponse; saml;
License
BSD-2-Clause License