Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP digest on router #65

Open
gawen opened this issue Dec 2, 2016 · 0 comments
Open

HTTP digest on router #65

gawen opened this issue Dec 2, 2016 · 0 comments

Comments

@gawen
Copy link

gawen commented Dec 2, 2016

Hello,

I am unable to apply a DigestStrategy to a route defined in a express' Router.

Here's the following snippet. Note the variable use_router.

var handler = function(req, res) {
    res.json({"hello": "world"});
};

if (use_router) {
    var router = express.Router();
    router.get('/', passport.authenticate('digest', {session: false}), handler);
    app.use("/hello", router);
} else {
    app.get('/hello', passport.authenticate('digest', {session: false}), handler);
}

I expected to received {"hello": "world"} if I GET on /hello the right username (any value) and password ("password").

curl -v --user user:password --digest http://localhost:8888/hello

It does when use_router is false, BUT it does not when use_router is true.

I would expect aaplying a DigestStrategy to a route registered in a router to work, but it appears it does not.

Used versions:

  • express: "^4.14.0"
  • passport: "^0.3.2"
  • passport-http: "^0.3.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant