Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#12 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
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分
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。