-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
/passport-http-oauth/strategies/utils:originalURL method. #14
Comments
This appears to be fixed by PR #10, would it be possible to have it merged in? |
Ran into this issue recently when using express |
@ramesius I'd love to, but if I'm not mistaken, I need the repository owner to approve the pr first. |
CC @jaredhanson, any chance on getting this mentioned PR (#17) sorted out? |
I just stumbled over the same issue where I want to use express |
First of all thanks for the library. It`s very easy to implement 'oauth' server provider side with it.
Recently I had a task of creating several routes with the same beginning part of the url. For instance, the start of all urls is '/base' and every route under the base must be checked with 'oauth' (ConsumerStrategy from the library) passport authentication middleware, like the following:
app.use('/base', passport.authenticate('oauth', {session: false}), require('./oauth-api'));
in the 'oauth-api' file I create a Route and add 8 urls. So, the complete routes look like this:
router.get('/route1', controller.route1); router.get('/routeN', controller.routeN);
When an oauth Consumer prepares a request to my server, it creates oauth_signature. The URL part of the signature would be like the following:
http://localhost:{port}/base/route1
Whereas the library would consider the url without the base, like this:
http://localhost:{port}/route1
And therefore the signatures don`t match.
The solution that worked for me was to amend ,mentioned in the topic, the 'originalURL' the line
path = req.url || '';
to the line
path = req.originalUrl || '';
The text was updated successfully, but these errors were encountered: