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

passport-saml

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passport-saml - npm Package Compare versions

Comparing version 0.5.3 to 0.6.0

40

lib/passport-saml/saml.js

@@ -243,2 +243,30 @@ var zlib = require('zlib');

SAML.prototype.getAdditionalParams = function (req, operation) {
var additionalParams = {};
var RelayState = req.query && req.query.RelayState || req.body && req.body.RelayState;
if (RelayState) {
additionalParams.RelayState = RelayState;
}
var optionsAdditionalParams = this.options.additionalParams || {};
Object.keys(optionsAdditionalParams).forEach(function(k) {
additionalParams[k] = optionsAdditionalParams[k];
});
var optionsAdditionalParamsForThisOperation = {};
if (operation == "authorize") {
optionsAdditionalParamsForThisOperation = this.options.additionalAuthorizeParams || {};
}
if (operation == "logout") {
optionsAdditionalParamsForThisOperation = this.options.additionalLogoutParams || {};
}
Object.keys(optionsAdditionalParamsForThisOperation).forEach(function(k) {
additionalParams[k] = optionsAdditionalParamsForThisOperation[k];
});
return additionalParams;
};
SAML.prototype.getAuthorizeUrl = function (req, callback) {

@@ -249,4 +277,4 @@ var self = this;

return callback(err);
var RelayState = req.query && req.query.RelayState || req.body && req.body.RelayState;
self.requestToUrl(request, null, 'authorize', RelayState ? { RelayState: RelayState } : {}, callback);
var operation = 'authorize';
self.requestToUrl(request, null, operation, self.getAdditionalParams(req, operation), callback);
});

@@ -257,4 +285,4 @@ };

var request = this.generateLogoutRequest(req);
var RelayState = req.query && req.query.RelayState || req.body && req.body.RelayState;
this.requestToUrl(request, null, 'logout', RelayState ? { RelayState: RelayState } : {}, callback);
var operation = 'logout';
this.requestToUrl(request, null, operation, this.getAdditionalParams(req, operation), callback);
};

@@ -264,4 +292,4 @@

var response = this.generateLogoutResponse(req, req.samlLogoutRequest);
var RelayState = req.query && req.query.RelayState || req.body && req.body.RelayState;
this.requestToUrl(null, response, 'logout', RelayState ? { RelayState: RelayState } : {}, callback);
var operation = 'logout';
this.requestToUrl(null, response, operation, this.getAdditionalParams(req, operation), callback);
};

@@ -268,0 +296,0 @@

12

package.json
{
"name": "passport-saml",
"version": "0.5.3",
"version": "0.6.0",
"licenses": [

@@ -34,13 +34,13 @@ {

"passport": "0.2.x",
"q": "1.0.x",
"q": "1.1.x",
"xml2js": "0.4.x",
"xml-crypto": "0.1.x",
"xmldom": "0.1.x",
"xmlbuilder": "~2.2",
"xmlbuilder": "~2.4",
"xml-encryption": "~0.7"
},
"devDependencies": {
"body-parser": "1.2.x",
"ejs": "0.7.x",
"express": "3.x",
"body-parser": "1.9.x",
"ejs": "1.0.x",
"express": "4.x",
"jshint": "*",

@@ -47,0 +47,0 @@ "mocha": "*",

@@ -37,3 +37,3 @@ Passport-SAML

})
));
);
```

@@ -46,2 +46,5 @@

* `entryPoint`: identity provider entrypoint
* `additionalParams`: dictionary of additional query params to add to all requests
* `additionalAuthorizeParams`: dictionary of additional query params to add to 'authorize' requests
* `additionalLogoutParams`: dictionary of additional query params to add to 'logout' requests
* `issuer`: issuer string to supply to identity provider

@@ -185,1 +188,4 @@ * `cert`: see 'security and signatures'

### Is there an example I can look at?
Gerard Braad has provided an example app at https://github.com/gbraad/passport-saml-example/

Sorry, the diff of this file is too big to display

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