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

Any plan of supporting POST request issued from openid-provider after authtentication passed #29

Open
catinthesky opened this issue Jul 31, 2014 · 2 comments

Comments

@catinthesky
Copy link

Hello,
Recently I fount the module (passport-openid) seems now not supporting POST request issued from OpenID-provider after passing the authentication (here meaning after inputting the username and password), and the relying node.js app side would hang there in fact trapped in the deal loop, further checking shows that it's the openid-passport module not support this POST request type, the relevant code I found are:

  1. In passport-openid's strategy.js:
    Strategy.prototype.authenticate = function(req) {
    if (req.query['openid.mode'] === 'cancel') { return this.fail({ message: 'OpenID authentication canceled' }); }
    //here the code assume, the request to be GET method

  2. and openid module's openid.verifyAssertion function which seems not have a good support for POST request.

So is there any plan to support the POST request ?

Thanks a lot.

@SatyaBulusu
Copy link

@jaredhanson Hi Jared, Thanks for building such a useful library. In my case, the OP is issuing a POST reuest. As @yaozaiyong mentioned, any plans to handle the POST request and parse the form data from request body.

vbernabe added a commit to vbernabe/passport-openid that referenced this issue Nov 15, 2014
vbernabe added a commit to vbernabe/passport-openid that referenced this issue Nov 15, 2014
@zackerydev
Copy link

Here's a workaround I've user to handle the POST call, not to revive a dead issue but this might help someone in the future:

app.post(
  '/auth/openid/return',
  (req, res, next) => {
    if (req.body['openid.mode']) {
      req.url = req.url + '?' + qs.stringify(req.body);
    }
    req.query = req.body;
    next();
  },
  passport.authenticate('openid', {
    failureRedirect: '/login'
  }),
  (req, res) => {
    res.redirect('/');
  }
);

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

3 participants