panva / openid-client

OAuth 2 / OpenID Connect Client API for JavaScript Runtimes
MIT License
1.83k stars 392 forks source link

Redirect loop when using passport strategy with hybrid flow #194

Closed naveddeshmukh closed 5 years ago

naveddeshmukh commented 5 years ago

On Login Callback, the passport.authenticate middleware redirects back to IdP which in turn creates a loop.

I'm currently using openid-client's passport strategy with express js to implement a relying party. The RP needs to authenticate a user and also requires access tokens to make API callbacks.

Sample Repository: https://github.com/naveddeshmukh/openid-client-hybrid-flow

Line Reference for passport authenticate middleware. https://github.com/naveddeshmukh/openid-client-hybrid-flow/blob/4d709ffb158434b9c639ae85fea59c7dd38bba05/server.js#L112

panva commented 5 years ago

https://github.com/panva/node-openid-client/issues/39#issuecomment-313167274