danny-avila / LibreChat

Enhanced ChatGPT Clone: Features Anthropic, AWS, OpenAI, Assistants API, Azure, Groq, o1, GPT-4o, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, langchain, DALL-E-3, ChatGPT Plugins, OpenAI Functions, Secure Multi-User System, Presets, completely open-source for self-hosting. Actively in public development.
https://librechat.ai/
MIT License
17.94k stars 2.99k forks source link

[Bug]: OpenId Configuration http proxy support for downloading Images (profile picture) #3261

Closed schnaker85 closed 3 months ago

schnaker85 commented 3 months ago

What happened?

We did configure the openID Strategy successfully and also added the PROXY env variable to proxy the requests to Azure Entra ID endpoints. The user can now successfully login with Entra ID and everything works as expected but the Profile Picture can not be downloaded from Microsoft due to the reason, that the downloadImage function does not use the proxy for the http request.

The OpenId Proxy support was added with pull request https://github.com/danny-avila/LibreChat/pull/3051 just recently.

Steps to Reproduce

  1. Configure Proxy via PROXY Env variable
  2. Setup OpenId Strategy
  3. Login with a user and check if the profile picture/Image was downloaded

What browsers are you seeing the problem on?

Chrome

Relevant log output

{"level":"error","message":"[openidStrategy] downloadImage: Error downloading image at URL \"https://graph.microsoft.com/v1.0/me/photo/$value\": FetchError: request to https://graph.microsoft.com/v1.0/me/photo/$value failed, reason: read ECONNRESET","timestamp":"2024-07-04T07:53:26.444Z"}

Screenshots

No response

Code of Conduct

berry-13 commented 3 months ago

@schnaker85 Can you check this PR #3263 and tell me if it works?

schnaker85 commented 2 months ago

@berry-13 I verified it with the latest dev docker image version and it does work. Thanks for the update and the fix!

berry-13 commented 2 months ago

@berry-13 I verified it with the latest dev docker image version and it does work. Thanks for the update and the fix!

Nice, you're welcome!