Skip to content

Commit

Permalink
Merge pull request #216 from alvinward/master
Browse files Browse the repository at this point in the history
Add support for ProviderName attribute
  • Loading branch information
markstos authored Oct 9, 2017
2 parents 92f1047 + c30df53 commit 42eb8f6
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ node_js:
- "4.0"
- "stable"

before_install:
- npm install -g npm

script:
- npm test
- ./node_modules/.bin/jshint lib
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ passport.use(new SamlStrategy(
* `disableRequestedAuthnContext`: if truthy, do not request a specific auth context
* `authnContext`: if truthy, name identifier format to request auth context (default: `urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport`)
* `forceAuthn`: if set to true, the initial SAML request from the service provider specifies that the IdP should force re-authentication of the user, even if they possess a valid session.
* `providerName`: optional human-readable name of the requester for use by the presenter's user agent or the identity provider
* `skipRequestCompression`: if set to true, the SAML request from the service provider won't be compressed.
* `authnRequestBinding`: if set to `HTTP-POST`, will request authentication from IDP via HTTP POST binding, otherwise defaults to HTTP Redirect
* **InResponseTo Validation**
Expand All @@ -78,6 +79,7 @@ passport.use(new SamlStrategy(
* `additionalLogoutParams`: dictionary of additional query params to add to 'logout' requests
* `logoutCallbackUrl`: The value with which to populate the `Location` attribute in the `SingleLogoutService` elements in the generated service provider metadata.


### Provide the authentication callback

You need to provide a route corresponding to the `path` configuration parameter given to the strategy:
Expand Down
4 changes: 4 additions & 0 deletions lib/passport-saml/saml.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ SAML.prototype.generateAuthorizeRequest = function (req, isPassive, callback) {
request['samlp:AuthnRequest']['@AttributeConsumingServiceIndex'] = self.options.attributeConsumingServiceIndex;
}

if (self.options.providerName) {
request['samlp:AuthnRequest']['@ProviderName'] = self.options.providerName;
}

callback(null, xmlbuilder.create(request).end());
})
.fail(function(err){
Expand Down
31 changes: 31 additions & 0 deletions test/tests.js

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

0 comments on commit 42eb8f6

Please sign in to comment.