メインコンテンツまでスキップ

Google Drive で独自のクライアント ID を使う

Google Drive リモートに client_id がない場合、rclone は rclone の共有クライアント ID でサインインします。このクライアント ID のリクエスト上限は多くの rclone ユーザーで共有されているため、共有 ID を使うリモートは遅くなったり、403 エラーで失敗したりすることがあります。rclone のドキュメントによると、共有クライアント ID は廃止が進められており、2026 年中に動作しなくなります。

client_id が空の場合、RcloneView は Add Google Drive ダイアログと Edit Remote ダイアログに次の案内を表示します。

Add Google Drive dialog showing the shared client ID notice and the How to create your own client ID link

このガイドでは、Google Cloud コンソールで独自のクライアント ID とクライアントシークレットを作成して RcloneView に入力し、再度サインインする方法を説明します。ステップ 1〜5 は Google Cloud コンソールで、ステップ 6〜7 は RcloneView で行います。

動画で確認したい場合は、以下の各手順をたどる 3 分間の動画(英語字幕)をご覧ください。

以下の手順は rclone のガイド Making your own client_id(How to create your own client ID リンクが開くページ)に沿っており、2026 年 12 月時点の Google Cloud コンソールの画面に合わせています。Google はコンソールの画面をときどき変更します。以下の名称が画面と異なる場合は rclone のガイドを確認してください。


ステップ 1: プロジェクトを作成し Google Drive API を有効にする​

  1. Google Cloud コンソールにサインインします。どの Google アカウントでもかまいません。接続したい Google Drive のアカウントと同じである必要はありません。

  2. ページ上部のプロジェクト選択ツールを開き、新しいプロジェクトを作成します(既存のプロジェクトを選択してもかまいません)。Project name(例: rcloneview-client-id)を入力して Create をクリックします。Google Workspace アカウントでサインインしている場合は 組織のドメインが入った Organization 欄も表示されますが(下のスクリーンショットは Workspace アカウントで撮影したものです)、そのままでかまいません。個人の Google アカウント(Gmail)では Organization 欄はなく、Location に No organization と表示されます。こちらもそのままでかまいません。

    Google Cloud New Project page with the project name rcloneview-client-id and the Create button
  3. ページ上部で新しいプロジェクトが選択されていることを確認します。検索バーで Google Drive API を検索して開き、Enable をクリックします。

    Google Drive API product details page with the Enable button

ステップ 2: OAuth 同意画面を構成する​

  1. APIs & Services › Credentials に移動します(左パネルの Credentials をクリックします。ウィザードが開く Create credentials ではありません)。「Remember to configure the OAuth consent screen」というバナーが表示されます。Configure consent screen をクリックし、Get started をクリックします。

    Credentials page with the banner asking to configure the OAuth consent screen and the Configure consent screen button
  2. Project configuration ウィザードが開きます。1 App Information で App name(例: rclone)を入力し、User support email(自分のメールアドレスで問題ありません)を選んで Next をクリックします。

    Project configuration wizard, App Information step with the App name rclone and a user support email
  3. 2 Audience で External を選択して Next をクリックします。Google Workspace アカウントを使っていて、このクライアント ID を組織内のユーザーだけが使う場合は Internal を選択してもかまいません。その場合、テストユーザーの追加や公開(ステップ 4)は不要です。

    Project configuration wizard, Audience step with Internal and External options and External selected
  4. 3 Contact Information で、Google がプロジェクトに関する通知を送るメールアドレスを入力し、Next をクリックします。

  5. 4 Finish で I agree to the Google API Services User Data Policy にチェックを入れ、Continue をクリックしてから Create をクリックします。


ステップ 3: Google Drive のスコープを追加する​

  1. 左パネルの Data Access をクリックし、Add or remove scopes をクリックします。Update selected scopes パネルが開きます。

  2. 下にスクロールして Manually add scopes に次の 3 つのスコープを貼り付け(1 行に 1 つ、またはカンマ区切り)、Add to table をクリックします。

    • https://www.googleapis.com/auth/docs
    • https://www.googleapis.com/auth/drive
    • https://www.googleapis.com/auth/drive.metadata.readonly
    Update selected scopes panel with the three Google Drive scopes pasted into Manually add scopes
  3. 3 つのスコープがチェックされた状態で表の先頭に表示されます。パネル下部の Update をクリックします。

    Update selected scopes panel with the docs, drive and drive.metadata.readonly scopes checked and the Update button
  4. Data Access ページに戻ると、スコープが Your sensitive scopes と Your restricted scopes の下に表示されます。ページ下部の Save をクリックします。Save をクリックするまでスコープは保存されません。

    Data Access page listing the auth/docs scope under sensitive scopes and the auth/drive scopes under restricted scopes, with the Save button

ステップ 4: 自分をテストユーザーとして追加する​

ステップ 2 で Internal を選択した場合、このステップは不要です。

  1. 左パネルの Audience をクリックします。Test users の下にある + Add users をクリックします。

  2. 接続したい Google Drive を所有する Google アカウントのメールアドレスを入力し、Save をクリックします。

    Audience page with Publishing status Testing, a greyed-out Publish app button, and the Add users panel with one test user and the Save button

これで Publishing status は Testing になります。Branding ページの設定を完了するまで、Publish app ボタンはグレーアウトしたままです(「To publish your app, you must complete your configuration on the Branding page」)。Branding には、アプリケーションのホームページ、プライバシーポリシーのリンク、承認済みドメイン(authorized domain)が必要です。詳しくは rclone のガイドを参照してください。公開しなくても、Testing のままクライアント ID を使えます。

Testing と公開

アプリを Testing のままにしておくこともできますが、その場合 Google のサインイン許可は約 1 週間で失効し、再度サインインが必要になります。アプリを公開するとこの問題を避けられます。個人利用(ユーザー 100 人未満)であれば通常 Google のアプリ審査(verification)は不要で、サインイン時に「unverified app」の警告が表示されるだけなので、そのまま進めてかまいません。


ステップ 5: OAuth クライアント ID を作成する​

  1. 左パネルの Clients をクリックし、新しいクライアントを作成します。Create OAuth client ID ページで Application type に Desktop app を選びます。Name はデフォルト(例: Desktop client 1)のままでかまいません。Create をクリックします。

    Create OAuth client ID page with Application type Desktop app, the name Desktop client 1 and the Create button
  2. OAuth client created ダイアログに Client ID と Client secret が表示されます。コピーボタンで両方をコピーして安全な場所に保管するか、Download JSON をクリックします。その後 OK をクリックします。

    OAuth client created dialog with the Client ID, the masked Client secret, the warning that the secret cannot be viewed again, and the Download JSON and OK buttons
ダイアログを閉じる前にクライアントシークレットをコピーしてください

OAuth client created ダイアログを閉じると、クライアントシークレットは二度と表示もダウンロードもできません。クライアント ID は後から Clients でいつでも確認できますが、シークレットをなくした場合は新しいクライアントを作成する必要があります。OK をクリックする前にクライアントシークレットをコピーするか Download JSON をクリックし、他人に公開しないでください。


ステップ 6: RcloneView にクライアント ID を入力する​

既存の Google Drive リモートの場合​

  1. リモートの Edit Remote ダイアログを開きます。Remote タブで Remote Manager をクリックし、Google Drive リモートのカードの Edit をクリックします。そのリモートを表示している Explorer ペインの右上にある 歯車アイコン をクリックしてもかまいません。リモート設定の編集を参照してください。ダイアログに共有クライアント ID の案内が表示されます。

    RcloneView Remote Manager with the Edit Google Drive dialog showing the shared client ID notice and the Show advanced options link
  2. Show advanced options をクリックします。client_id と client_secret の欄が表示されます。

    Edit Google Drive dialog with advanced options shown, including the empty client_id and client_secret fields
  3. client_id にクライアント ID を、client_secret にクライアントシークレットを貼り付けます。client_id に値が入るとすぐに、共有クライアント ID の案内が消えます。

    Edit Google Drive dialog with client_id and client_secret filled in and the shared client ID notice gone
  4. Save をクリックし、ステップ 7 に進みます。

新しい Google Drive リモートの場合​

  1. Remote メニューの + New Remote をクリックし、Google Drive を選択します。

    New Remote dialog with the list of providers including Google Drive
  2. Remote name を入力します。

  3. Show advanced options をクリックします。client_id と client_secret の欄は詳細オプションにあります。

  4. client_id にクライアント ID を、client_secret にクライアントシークレットを貼り付けます。

  5. Add Remote をクリックし、ステップ 7 に進みます。


ステップ 7: Google にサインインする​

共有クライアント ID で行った Google のサインインは独自のクライアント ID には引き継がれないため、リモートは新しい ID で再度サインインする必要があります。

  1. Save(または Add Remote)をクリックすると、最初にリモートを追加したときと同じようにブラウザで Google のサインインページが開きます。
  2. Google Drive を所有するアカウントでサインインし(External を選んだ場合は、ステップ 4 で追加したテストユーザーである必要があります)、アクセスを許可します。
  3. アプリが Testing の間は、Google が「unverified app」の警告を表示することがあります。これはステップ 2 で作成したアプリのことです。Advanced をクリックし、Go to rclone (unsafe) をクリックします(ステップ 2 で入力したアプリ名が表示されます)。
  4. ブラウザに rclone の成功ページが表示されます。ブラウザのタブを閉じて RcloneView に戻ります。

保存後もリモートが失敗する場合は、同じクライアント ID とクライアントシークレットで新しい Google Drive リモートを追加し(ステップ 6 の「新しい Google Drive リモートの場合」を参照)、Remote Manager で古いリモートを削除します。

結果を確認する​

Edit Remote ダイアログをもう一度開きます。client_id に値が入ったので、共有クライアント ID の案内は表示されなくなります。

Edit Google Drive dialog reopened after saving, without the shared client ID notice

これでリモートは多くの rclone ユーザーで共有される上限ではなく自分専用のリクエスト上限を使うため、フォルダーの閲覧は通常速くなり、403 エラーで失敗する可能性も低くなります。

Google Photos

Google Photos のリモートにも独自のクライアント ID が必要で、手順が異なります(Photos Library API とそのスコープ)。rclone のガイド Google Photos: Making your own client_id を参照してください。

外部 rclone

このガイドは、お使いのコンピューターでブラウザを開いてサインインできる RcloneView 内蔵の rclone を前提としています。ブラウザのないサーバーで動作する rclone については、AWS EC2 上の外部 Rclone に Google Drive を追加するを参照してください。


関連ガイド​