jaredhanson / passport-openidconnect

OpenID Connect authentication strategy for Passport and Node.js.
https://www.passportjs.org/packages/passport-openidconnect/?utm_source=github&utm_medium=referral&utm_campaign=passport-openidconnect&utm_content=about
MIT License
188 stars 173 forks source link

Added passing of configured agent through to the oauth2 object #49

Closed PhilipSkinner closed 2 years ago

PhilipSkinner commented 7 years ago

In order to use this with servers utilising HTTPS certificates that do not appear in the global ca_certs within node, you need to construct a custom agent and use it for any HTTPS requests.

I have updated the oauth2 library (0.9.15) to add this ability, and I have added in the small snippet of code below to pass through any given agent to that library.

No test coverage.

PhilipSkinner commented 2 years ago

Many thanks for accepting this!

jaredhanson commented 2 years ago

You're welcome! Thanks for submitting the PR.

I made a slight modification, switching the agent option to be passed to the Strategy constructor, rather than authenticate(). Options to authenticate() are intended more for authentication parameters (max age, display, etc), whereas the constructor options impact internal behavior - the latter seeming more fitting for this option. The changes make it similar to PR #65.

I've got a bit more maintenance and cleanup work, and then this will be published in the next release.