Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở Phù hợp với người mới
#12 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp
Lĩnh vực
api, authentication

Hướng nghiên cứu

Bắt đầu với app/src/SsoBridge.hpp để xác nhận Google OAuth callback URI, sau đó chạy bản tái hiện bằng curl từ issue cho client ID được liệt kê. Được xem là hoàn tất khi các URI chuyển hướng được ủy quyền chấp nhận API callbacks và Sign in with Google đi đến luồng đăng nhập thay vì redirect_uri_mismatch; Apple được đề cập nhưng chưa được xác minh.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C++
Star
1
Fork
1
Merge trung bình
2 giờ 59 phút
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.