LibreChat/api/strategies
Anubhav Anand 65e2838038
🔧 fix: Honor NO_PROXY for OpenID requests when PROXY is set (#13716)
* 🔧 fix: Honor NO_PROXY for OpenID requests when PROXY is set

openidStrategy routed every OIDC request (issuer discovery, JWKS,
token endpoint, Microsoft Graph overage resolution) through
undici.ProxyAgent whenever PROXY was set. undici.ProxyAgent does not
consult NO_PROXY, so OIDC providers on internal networks that the
corporate proxy cannot reach failed at startup with ECONNREFUSED or
discovery timeouts, even when the issuer host was listed in NO_PROXY.

Replace ProxyAgent with undici.EnvHttpProxyAgent configured to use
PROXY for both protocols. EnvHttpProxyAgent applies the standard
NO_PROXY/no_proxy exclusion list per request host (suffix matching,
leading-dot domains, host:port entries, and *), so excluded hosts are
requested directly.

The agent is also memoized (keyed on PROXY + NO_PROXY) instead of
being constructed per request, so repeated OIDC calls reuse one
connection pool.

Fixes #13705

* fix: move OpenID proxy helper to api package

* chore: import order in openidStrategy.js

* chore: import order in openidStrategy.spec.js

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
2026-06-13 11:39:48 -04:00
..
appleStrategy.js 🔐 feat: Admin Auth Support for SAML and Social OAuth Providers (#12472) 2026-03-30 22:49:44 -04:00
appleStrategy.test.js 🛂 feat: Social Login by Provider ID First then Email (#10358) 2025-11-05 09:20:35 -05:00
discordStrategy.js 🔐 feat: Admin Auth Support for SAML and Social OAuth Providers (#12472) 2026-03-30 22:49:44 -04:00
facebookStrategy.js 🔐 feat: Admin Auth Support for SAML and Social OAuth Providers (#12472) 2026-03-30 22:49:44 -04:00
githubStrategy.js 🔐 feat: Admin Auth Support for SAML and Social OAuth Providers (#12472) 2026-03-30 22:49:44 -04:00
googleStrategy.js 🔐 feat: Admin Auth Support for SAML and Social OAuth Providers (#12472) 2026-03-30 22:49:44 -04:00
index.js 🔐 feat: Admin Auth Support for SAML and Social OAuth Providers (#12472) 2026-03-30 22:49:44 -04:00
jwtStrategy.js 🧑‍💻 refactor: Secure Field Selection for 2FA & API Build Sourcemap (#9087) 2025-08-15 18:55:49 -04:00
ldapStrategy.js 🏢 feat: Tenant-Scoped App Config in Auth Login Flows (#12434) 2026-03-27 16:08:43 -04:00
ldapStrategy.spec.js 🏢 feat: Tenant-Scoped App Config in Auth Login Flows (#12434) 2026-03-27 16:08:43 -04:00
localStrategy.js 🔐 fix: Avoid Logging Password On Login Validation Error (#12926) 2026-05-03 21:27:41 -04:00
openIdJwtStrategy.js 🪪 feat: Accept Multiple OpenID JWT Audiences (#13404) 2026-05-29 13:45:41 -07:00
openIdJwtStrategy.spec.js 🪪 feat: Accept Multiple OpenID JWT Audiences (#13404) 2026-05-29 13:45:41 -07:00
openidStrategy.js 🔧 fix: Honor NO_PROXY for OpenID requests when PROXY is set (#13716) 2026-06-13 11:39:48 -04:00
openidStrategy.spec.js 🔧 fix: Honor NO_PROXY for OpenID requests when PROXY is set (#13716) 2026-06-13 11:39:48 -04:00
process.js 🛂 feat: Social Login by Provider ID First then Email (#10358) 2025-11-05 09:20:35 -05:00
process.test.js 🛂 feat: Social Login by Provider ID First then Email (#10358) 2025-11-05 09:20:35 -05:00
samlStrategy.js 🪪 fix: Use Shared IdP Avatar Processing (#13422) 2026-05-30 16:51:58 -07:00
samlStrategy.spec.js 🪪 fix: Use Shared IdP Avatar Processing (#13422) 2026-05-30 16:51:58 -07:00
socialLogin.js 🔐 feat: Admin Auth Support for SAML and Social OAuth Providers (#12472) 2026-03-30 22:49:44 -04:00
socialLogin.test.js 🏢 feat: Tenant-Scoped App Config in Auth Login Flows (#12434) 2026-03-27 16:08:43 -04:00
validators.js 🔐 feat: Add Configurable Min. Password Length (#9315) 2025-08-27 16:30:56 -04:00
validators.spec.js 🔐 feat: Add Configurable Min. Password Length (#9315) 2025-08-27 16:30:56 -04:00