Skip to content

TokenStrategy doesn't play nicely with Express Routes #13

Open
@dpjanes

Description

@dpjanes

Let's say you create an app with a router (free typing follows)

route = express.Router();
route.get('/profile',   
    passport.authenticate('token', {
            session: false
     }), _get_profile);

app = express();
app.use("/api/1.0", route);

when helpers.originalURL is called, it will come up with /profile/ which then will be fed into the HMAC-SHA1 algorithm for the base (at around line 206 of token.js)

Unfortunately, the client has computed the base using /api/1.0/profile and so the signatures don't match.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions