Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Sign in with Google fails with redirect_uri_mismatch: api callback not registered on the Google client

未关闭 适合新手
#12 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
cpp

调研方向

先从 app/src/SsoBridge.hpp 开始,确认 Google OAuth callback URI,然后针对列出的 client ID 运行 issue 中的 curl 复现。完成的标准是:已授权的重定向 URI 接受 API callbacks,并且 Sign in with Google 进入登录流程,而不是出现 redirect_uri_mismatch;提到了 Apple,但尚未验证。

由索引模型根据 Issue 内容生成。

描述

Summary

On Linux, "Sign in with Google" always ends at Google's error page:

Access blocked: This app's request is invalid
Error 400: redirect_uri_mismatch

Version: v2026.9.19-1050096260 (URnetwork-2026.9.19-1050096260-amd64.AppImage), NixOS, default ur.network / main network space.

Cause

Per app/src/SsoBridge.hpp, the app opens

https://accounts.google.com/o/oauth2/v2/auth?client_id=338638865390-cg4m0t700mq9073smhn9do81mr640ig1.apps.googleusercontent.com
    &redirect_uri=<api>/auth/google/callback&response_type=code&scope=openid%20email%20profile&...

Google rejects that redirect URI for this client id before the account is even chosen, so the callback is not registered as an authorized redirect URI on the web client. This is reproducible without the app or a Google session:

CID=338638865390-cg4m0t700mq9073smhn9do81mr640ig1.apps.googleusercontent.com
for r in https://api.ur.network/auth/google/callback https://api.bringyour.com/auth/google/callback; do
  curl -s -o /dev/null -w '%{redirect_url}\n' \
    "https://accounts.google.com/o/oauth2/v2/auth?client_id=$CID&redirect_uri=$(python3 -c 'import urllib.parse,sys;print(urllib.parse.quote(sys.argv[1],safe=""))' "$r")&response_type=code&scope=openid%20email%20profile&state=x"
done

Both print https://accounts.google.com/signin/oauth/error?authError=ChVyZWRpcmVjdF91cmlfbWlzbWF0Y2g... (base64 of redirect_uri_mismatch). A registered URI redirects to the sign-in page instead.

https://api.ur.network/auth/google/callback (and the api.bringyour.com variant) need to be added to the client's authorized redirect URIs. Sign in with Apple uses the same <api>/auth/apple/callback shape and is probably in the same state, though I have not verified it.

Workaround

Auth code / email sign-in work fine.


Diagnosed with help from Claude Code.

主要语言
C++
星标
1
派生
1
平均合并
2 小时 59 分钟
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。