Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 无效返回链接, 该 redirect_uri 未被此应用注册 #5234

Open
TigerBeanst opened this issue Dec 30, 2024 · 4 comments
Open

[Bug] 无效返回链接, 该 redirect_uri 未被此应用注册 #5234

TigerBeanst opened this issue Dec 30, 2024 · 4 comments
Labels
🐛 Bug Something isn't working | 缺陷

Comments

@TigerBeanst
Copy link

TigerBeanst commented Dec 30, 2024

📦 部署环境

Docker(Compose)

📌 软件版本

1.42.1

💻 系统环境

Windows

🌐 浏览器

Edge

🐛 问题描述

在未登录的浏览器中触发登录,会提示如下信息:

{
    "code": "oidc.invalid_redirect_uri",
    "message": "无效返回链接, 该 redirect_uri 未被此应用注册。",
    "error": "invalid_redirect_uri",
    "error_description": "redirect_uri did not match any of the client's registered redirect_uris",
    "iss": "https://lobe-auth-api.[域名]/oidc"
}

已登录的浏览器不受影响。
之前是可以使用的,最近对logto的变更只有更新镜像后由于无法启动 logto ,参考 issue 区将 docker-compose 文件中的 logto 版本锁定在 1.19.0

附Logto截图
image
image

其中 Redirect URI 配置是 https://chat.[域名]/api/auth/callback/logto (访问 https://chat.[域名] 可正常打开 LobeChat)

另,已尝试 #5067

📷 复现步骤

No response

🚦 期望结果

No response

📝 补充信息

No response

@TigerBeanst TigerBeanst added the 🐛 Bug Something isn't working | 缺陷 label Dec 30, 2024
@github-project-automation github-project-automation bot moved this to Roadmap - Chat 1.x in Lobe Chat Routine Dec 30, 2024
@lobehubbot
Copy link
Member

👀 @TigerBeanst

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

Copy link

dosubot bot commented Dec 30, 2024

The 'invalid_redirect_uri' error you're encountering is typically due to a mismatch between the redirect URI configured in your authentication provider and the one used by your application. Here are some steps to troubleshoot and resolve this issue:

  1. Verify Redirect URI Configuration: Ensure that the redirect URI configured in Logto matches exactly with the one used by Lobe Chat. It should be in the format:

    https://chat.[your-domain]/api/auth/callback/logto
    

    Make sure there are no typos or mismatches in the domain or path.

  2. Check Logto Version: Since you mentioned locking the Logto version to 1.19.0, ensure that this version supports the redirect URI configuration you are using. There might be changes in newer versions that affect how redirect URIs are validated.

  3. Environment Variables: Double-check the environment variables in your Docker setup. Ensure that NEXTAUTH_URL is set correctly to:

    NEXTAUTH_URL=https://chat.[your-domain]/api/auth
    
  4. CORS and Allowed Origins: Verify that the CORS allowed origins in Logto include your domain. This ensures that requests from your domain are accepted.

  5. Logto Configuration: Review the Logto configuration screenshots you provided to ensure all necessary fields are correctly filled out, especially the redirect URIs and issuer endpoint.

If these steps do not resolve the issue, consider checking for any recent changes in Logto's configuration requirements or consulting their documentation for any updates related to redirect URI handling.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@ukhack
Copy link

ukhack commented Jan 2, 2025

the same

@ukhack
Copy link

ukhack commented Jan 2, 2025

may not work fine with docker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷
Projects
Status: Roadmap - Chat 1.x
Development

No branches or pull requests

3 participants