Skip to content

Basic authentication issue (convert to another process?) #3

@cklanac

Description

@cklanac

@oampo @benjaminEwhite,

The dialog box used by basic authentication pops up when incorrect UN/PW submission.

The issue can be fixed by adding failWithError: true to the middleware as follows

const basicAuth = passport.authenticate('basic', { session: false, failWithError: true  });

This allows us to remove the www-authenticate header before sending the response which suppresses the built-in dialog.

app.use(function (err, req, res, next) {
  res.removeHeader('www-authenticate');
  next(err);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions