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

code/access_token query or body #33

Open
bmatusiak opened this issue May 13, 2013 · 0 comments
Open

code/access_token query or body #33

bmatusiak opened this issue May 13, 2013 · 0 comments

Comments

@bmatusiak
Copy link

can you add/change this to your lovely little module

    } else if(req.method == 'POST' && self.options.access_token_uri == uri) {
      var     client_id = req.body.client_id || req.query.client_id,
          client_secret = req.body.client_secret || req.query.client_secret,
           redirect_uri = req.body.redirect_uri || req.query.redirect_uri,
                   code = req.body.code || req.query.code;

im using everyauth as a client to oauth2

in the code it send via query not body... adding the || will fix issue

https://github.com/bnoguchi/everyauth/blob/master/lib/modules/oauth2.js#L186

this is exactly how it is sending code to retrieve access_token

also it my be nice to do this in "login" middleware function

 if(req.query['access_token'] || req.body['access_token']) {
      atok = req.query['access_token'] || req.body['access_token'];
    } else if((req.headers['authorization'] || '').indexOf('Bearer ') == 0) {
      atok = req.headers['authorization'].replace('Bearer', '').trim();
    } else {
      return next();
    }
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