Skip to main content
LibreChat is joining ClickHouse to power the open-source Agentic Data Stack 🎉 Learn more
LibreChat

Authelia

了解如何配置 LibreChat 以使用 Authelia 进行用户身份验证。

  • 使用以下命令生成客户端密钥 (client secret):
    docker run --rm authelia/authelia:latest authelia crypto hash generate pbkdf2 --variant sha512 --random --random.length 72 --random.charset rfc3986
  • 然后在你的 configuration.yml 中,在 oidc 部分添加以下内容:
      - client_id: 'librechat'
        client_name: 'LibreChat'
        client_secret: '$pbkdf2-GENERATED_SECRET_KEY_HERE'
        public: false
        authorization_policy: 'two_factor'
        redirect_uris:
          - 'https://LIBRECHAT.URL/oauth/openid/callback'
        scopes:
          - 'openid'
          - 'profile'
          - 'email'
        userinfo_signing_algorithm: 'none'
  • 然后重启 Authelia

LibreChat

  • 打开项目文件夹中的 .env 文件并添加以下变量:
    ALLOW_SOCIAL_LOGIN=true
    OPENID_BUTTON_LABEL='Log in with Authelia'
    OPENID_ISSUER=https://auth.example.com/.well-known/openid-configuration
    OPENID_CLIENT_ID=librechat
    OPENID_CLIENT_SECRET=ACTUAL_GENERATED_SECRET_HERE
    OPENID_SESSION_SECRET=ANY_RANDOM_STRING
    OPENID_CALLBACK_URL=/oauth/openid/callback
    OPENID_SCOPE="openid profile email"
    OPENID_IMAGE_URL=https://www.authelia.com/images/branding/logo-cropped.png
    # Optional: redirects the user to the end session endpoint after logging out
    OPENID_USE_END_SESSION_ENDPOINT=true 

这篇指南怎么样?