Skip to content

Readme is wrong #809

@MickL

Description

@MickL

The readme shows the following example:

passport.use(
  new MultiSamlStrategy(
    {
      passReqToCallback: true, // makes req available in callback
      getSamlOptions: function (request, done) {
        findProvider(request, function (err, provider) {
          if (err) {
            return done(err);
          }
          return done(null, provider.configuration);
        });
      },
    },
    function (req, profile, done) {
      // for signon
      findByEmail(profile.email, function (err, user) {
        if (err) {
          return done(err);
        }
        return done(null, user);
      });
    },
    function (req, profile, done) {
      // for logout
      findByNameID(profile.nameID, function (err, user) {
        if (err) {
          return done(err);
        }
        return done(null, user);
      });
    }
  )
);

But this doesnt seem to be valid JavaScript. All three parameter contain a function within a function:

function (request, done) {
            findProvider(request, function (err, provider) {

Further the example shows new SamlStrategy() and new MultiSamlStrategy() with three arguments but according to the TypeScript interface the constructor only accepts two arguments. In this case I wonder if the Typings are wrong or the readme.

Bildschirm­foto 2022-11-10 um 16 11 50

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationRequest for or contribution to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions