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.87k stars 2.96k forks source link

[Bug]: login failed done is not a function (OpenID) #4088

Closed dennis531 closed 1 week ago

dennis531 commented 1 week ago

What happened?

I tried to connect LibreChat with a OpenID Connect provider but it doesn't work. It seems that the callback function signature is invalid in https://github.com/danny-avila/LibreChat/blob/fc887ba84797c2ba29b5f2302f70458001b34290/api/strategies/openidStrategy.js#L101

Maybe related to https://github.com/danny-avila/LibreChat/issues/2652

Steps to Reproduce

  1. Configure .env file to enable OpenID:
    
    # OpenID
    OPENID_CLIENT_ID=mytranslationapp
    OPENID_CLIENT_SECRET=abc123
    OPENID_ISSUER=http://localhost/studip/plugins.php/openidproviderplugin
    OPENID_SESSION_SECRET=sessionsecret
    OPENID_SCOPE="openid profile email"
    OPENID_CALLBACK_URL=/oauth/openid/callback
    OPENID_REQUIRED_ROLE=
    OPENID_REQUIRED_ROLE_TOKEN_KIND=
    OPENID_REQUIRED_ROLE_PARAMETER_PATH=

OPENID_BUTTON_LABEL=Stud.IP OPENID_IMAGE_URL=

2. `docker compose up`
3. Login via Stud.IP OpenID Provider 

### What browsers are you seeing the problem on?

Firefox

### Relevant log output

```shell
error log:
{"level":"error","message":"[openidStrategy] login failed done is not a function","stack":"TypeError: done is not a function\n    at OpenIDConnectStrategy._verify (/app/api/strategies/openidStrategy.js:219:11)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"}

debug log:
2024-09-17T14:40:45.124Z info: [openidStrategy] verify login openidId: undefined
2024-09-17T14:40:45.124Z debug: [openidStrategy] very login tokenset and userinfo
{
    tokenset.id_token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJteXRyYW5zbGF0aW9uYXBwIiwiaXNzIjoiaHR0cDovL2xvY2FsaG9... [truncated]",
    tokenset.token_type: "Bearer",
    tokenset.expires_at: 1726587645,
    tokenset.access_token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJteXRyYW5zbGF0aW9uYXBwIiwianRpIjoiMjc0NjA5Nzc5NTJmZTA... [truncated]",
    tokenset.refresh_token: "def50200dab385b421de68c208dac6f0de105aa285a78e0338781b3d9bc66baeb9086841ebc5ea37a3d1f69a2dc3e709cd2c... [truncated]",
  userinfo: function,
}

2024-09-17T14:40:45.127Z info: [openidStrategy] user found with openidId: undefined
2024-09-17T14:40:45.136Z info: [openidStrategy] login success openidId: undefined | email: test@test.de | username:

Screenshots

No response

Code of Conduct