Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

saml-encoder-decoder-js

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

saml-encoder-decoder-js

Node.js module for encoding and decoding SAML request and response payloads for redirect or POST bindings

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.3K
increased by0.96%
Maintainers
1
Weekly downloads
 
Created
Source

saml-encoder-decoder-js

Routines assembled to encode and decode SAML 2 assertions in Node.js

Installation

To use these routines you first need to install the dependency:

npm install saml-encoder-decoder-js

Using the module

Once the module has been installed, require it into your application:

var saml = require('saml-encoder-decoder-js');

At that point, you can pass your SAML request or response XML to the redirect or POST binding encoding routines.

saml.encodeSamlRedirect(xml, function(err, encoded) {
  if (!err) {
    console.log("Redirect encoded string", encoded);
  }
});

saml.encodeSamlPost(xml, function(err, encoded) {
  if (!err) {
    console.log("POST encoded string", encoded);
  }
});

If, on the other hand, you need to decode previously encoded data, you would handle that like this:

saml.decodeSamlRedirect(xml, function(err, xml) {
  if (!err) {
    console.log("Redirect decoded XML", xml);
  }
});

saml.decodeSamlPost(xml, function(err, xml) {
  if (!err) {
    console.log("POST decoded XML", xml);
  }
});

Demo code

Two demo applications are included to show how the code works. Those are demo-redirect.js and demo-post.js. Each takes some XML, encoded it, and decodes it back to its original state.

The unit tests in the test folder will also provide insight into how the code works.

FAQs

Package last updated on 21 Nov 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc