Skip to content

Commit

Permalink
Merge pull request #67 from mikeops/error-on-missing-endpoint
Browse files Browse the repository at this point in the history
Converts exception to error when calling getSamlRequestUrl with an empty identityProviderUrl
  • Loading branch information
glena authored Jan 5, 2018
2 parents 1881504 + 0c8d19f commit 054dcec
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lib/passport-wsfed-saml2/samlp.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ Samlp.prototype = {

getSamlRequestUrl: function (opts, callback) {
var options = xtend(opts || {}, this.options);

if (!options.identityProviderUrl) {
return callback(new Error('Missing value for the identity provider login URL'));
}

var parsedUrl = url.parse(options.identityProviderUrl, true);

this.getSamlRequestParams(options, function (err, params) {
Expand Down
36 changes: 34 additions & 2 deletions test/samlp.tests.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 054dcec

Please sign in to comment.