Open catinthesky opened 10 years ago
@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.
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('/');
}
);
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.