Skip to content

Commit 054dcec

Browse files
authored
Merge pull request #67 from mikeops/error-on-missing-endpoint
Converts exception to error when calling getSamlRequestUrl with an empty identityProviderUrl
2 parents 1881504 + 0c8d19f commit 054dcec

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

lib/passport-wsfed-saml2/samlp.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@ Samlp.prototype = {
195195

196196
getSamlRequestUrl: function (opts, callback) {
197197
var options = xtend(opts || {}, this.options);
198+
199+
if (!options.identityProviderUrl) {
200+
return callback(new Error('Missing value for the identity provider login URL'));
201+
}
202+
198203
var parsedUrl = url.parse(options.identityProviderUrl, true);
199204

200205
this.getSamlRequestParams(options, function (err, params) {

test/samlp.tests.js

Lines changed: 34 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)