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

Add support for passing a custom http agent #1447

Merged
merged 6 commits into from
Oct 3, 2023

Conversation

ryanolson-aumni
Copy link
Contributor

There are times that you'd need to have a custom http agent for making the authentication requests (via openid-client). This can allow a user to provide their own agent so that they can proxy or do other things that they'd like to do.

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

📋 Changes

  • Add a configuration option for httpAgent so that users can provide their own http agent for authentication requests (such as an HttpsProxyAgent). This is important for corporate users that require going through a corporate proxy.

@vercel
Copy link

vercel bot commented Sep 20, 2023

@ryanolson-aumni is attempting to deploy a commit to the Auth0 Team on Vercel.

A member of the Team first needs to authorize it.

@ryanolson-aumni
Copy link
Contributor Author

@adamjmcgrath is this more in line with what you were thinking?

@evansims
Copy link
Member

@ryanolson-aumni 👋 Adam is on holiday this week, but he'll get back to you when he returns

There are times that you'd need to have a custom http agent for making
the authentication requests (via openid-client). This can allow a user
to provide their own agent so that they can proxy or do other things
that they'd like to do.

Resolves auth0#1425
@ryanolson-aumni ryanolson-aumni marked this pull request as ready for review September 27, 2023 17:11
@ryanolson-aumni ryanolson-aumni requested a review from a team as a code owner September 27, 2023 17:11
@adamjmcgrath
Copy link
Contributor

@adamjmcgrath is this more in line with what you were thinking?

These lgtm - thanks @ryanolson-aumni

You just need to add httpAgent to https://github.com/auth0/nextjs-auth0/blob/main/src/auth0-session/get-config.ts#L114 (use Joi.object().optional())

Also, could you add a note to the docstrings explaining that this option is for the Node runtime only.

@ryanolson-aumni
Copy link
Contributor Author

Thanks @adamjmcgrath. I added commits that address your feedback. 😀

Copy link
Contributor

@adamjmcgrath adamjmcgrath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamjmcgrath adamjmcgrath merged commit 6b39e94 into auth0:main Oct 3, 2023
2 checks passed
@adamjmcgrath adamjmcgrath mentioned this pull request Oct 5, 2023
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

Successfully merging this pull request may close these issues.

3 participants