Skip to content

[Bug]: Reuse OpenID Auth tokens does not work with PROXY Setup #8099

Closed
@schnaker85

Description

@schnaker85

What happened?

The new feature #7397 is not working with a proxy setup.

There are 2 main problems with the current implementation:

  • openidStrategy is using wrong httpproxy object (should use a specific from undici)
  • openIdJwtStrategy is not providing any http proxy to fetch the jd

I will provide a PR next week, which fixes / addresses this issue.

the fixes locally, which make it work are:

[openidStrategy.js](https://github.com/danny-avila/LibreChat/blob/dev/api/strategies/openidStrategy.js#L52

dispatcher: new undici.ProxyAgent(process.env.PROXY)

[openIdJwtStrategy.js](https://github.com/danny-avila/LibreChat/blob/dev/api/strategies/openIdJwtStrategy.js#L26

const { HttpsProxyAgent } = require('https-proxy-agent'); // first line
requestAgent: new HttpsProxyAgent(process.env.PROXY) // line 26

Version Information

librechat-dev-api:latest sha256:836cb26abad90d9700db0a73836b14e42a6a45a1c2bd3a2370ddb8fe37b97e45

Steps to Reproduce

  1. Deploy librechat-dev-api with the given sha256
  2. Configure librechat with entraid usage and reuse
    OPENID_USE_PKCE=true
    OPENID_REUSE_TOKENS=true
    OPENID_JWKS_URL_CACHE_ENABLED=True
    OPENID_USE_END_SESSION_ENDPOINT=True
    PROXY=http proxy
    `
  3. Login in the GU)
  4. Check browser requests, all endpoints requests, which require authentication will get 401
  5. No conversations can be loaded

What browsers are you seeing the problem on?

Chrome

Relevant log output

undici wrong setup results in: "TypeError: fetch failed"

the second problem will be sucked from the jwksRsa lib and only will result in 401

Screenshots

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions