LoginSignup
21
10

More than 3 years have passed since last update.

skickaの『「Google でログイン」機能が一時的に無効』を一時的に解決する

Last updated at Posted at 2020-01-03

問題

Google Drive の CLIツール skicka にログインする際、新しくskickaを使い始めるアカウントでログインしようとするとこんな画面になってしまいます。

screenchot20200102194747.png

原因(推測)

skicka のデフォルトの Google API キーの確認申請が行われていない。

2020/5/16 訂正
(skicka は Google 公式のはずですが……)
@mrmt さんよりコメントにて指摘を受けました。skicka は Google 公式のものではありません。訂正させていただきます。

対処法

Google Cloud Console を開いてプロジェクトを作り、自分で API キーの設定を行いましょう!
Google への確認申請を行わないので、認証できるアカウントが100アカウントまでの制限に加え、ログイン時に警告画面の表示もありますが、個人使用なら問題ないでしょう。

  • https://console.cloud.google.com/projectcreate ここでプロジェクトを作成します。

    createproj.png

    Project NameはなんでもOKです。
    CREATEを押して次に進みます。

  • 少し待てば、右上の通知アイコンのくるくるが終わって、完了します。
    通知を開き、Create Project: ***を押して作ったプロジェクトに切り替えます。

    スクリーンショット 2020-01-02 20.04.29.png

  • 左上のボタンからメニューを開き、APIs & Services --> Library を選択します。
    スクリーンショット 2020-01-03 17.41.27.png

  • google driveで検索します。
    スクリーンショット 2020-01-03 17.43.43.png

  • Google Drive API を選択します。
    スクリーンショット 2020-01-03 17.45.14.png

  • ENABLEを押して有効化します。
    スクリーンショット 2020-01-03 17.45.25.png

  • OAuth consent screenを開きます 。
    スクリーンショット 2020-01-03 17.46.51.png

  • External を選択し、CREATEを押します。
    スクリーンショット 2020-01-03 17.47.06.png

  • Name を適当に入力し、Saveを押します。
    スクリーンショット 2020-01-03 17.47.58.png
    中略
    スクリーンショット 2020-01-03 17.48.23.png

  • 左側の Credentials を選択し、 Create credentials --> OAuth client ID を選択します。
    スクリーンショット 2020-01-03 18.00.28.png

  • Other を選択し、 Createを押します。
    スクリーンショット 2020-01-03 17.48.59.png

  • Client ID と Client Secret が表示されればOKです。
    スクリーンショット 2020-01-03 17.49.34.png

  • .skicka.config を編集します。

    .skicka.config がないときは $ skicka init を実行してください。
    ホームディレクトリに.skicka.configが生成されます。

; Default .skicka.config file. See 
; https://github.com/google/skicka/blob/master/README.md for more
; information about setting up skicka.
[google]
    ;Override the default application client id used by skicka.
    ; 👉 以下の2行のコメントアウト(先頭のセミコロン)を外し、表示された ID, Secret に置き換えます
    clientid=xxx-xxxxx.apps.googleusercontent.com
    clientsecret=xxxxx-xxxxx_xxxxxxxxx
    ;An API key may optionally be provided.
    ;apikey=Yasdf
[encryption]
    ; Run 'skicka genkey' to generate an encyption key.
    ;salt=
    ;passphrase-hash=
    ;encrypted-key=
    ;encrypted-key-iv=
[upload]
    ; You may want to specify regular expressions to match local filenames
    ; that you want to be ignored by 'skicka upload'. Use one ignored-regexp
    ; line for each such regular expression.
    ;ignored-regexp="\\.o$"
    ;ignored-regexp=~$
    ;ignored-regexp="\\._"
    ;ignored-regexp="RECYCLE\\.BIN"
    ;ignored-regexp="Thumbs\\.db$"
    ;ignored-regexp="\\.git"
    ;ignored-regexp="\\.(mp3|wma|aiff)$"
    ;ignored-regexp="\\.~lock\\..*$"
    ;ignored-regexp="~\\$"
    ;ignored-regexp="\\.DS_Store$"
    ;ignored-regexp="desktop.ini"

    ;
    ; To limit upload bandwidth, you can set the maximum (average)
    ; bytes per second that will be used for uploads
    ;bytes-per-second-limit=524288  ; 512kB

以上の手順で使えるようになります。

$ skicka ls
skicka: attempting to launch browser to authorize.
(Re-run skicka with the -no-browser-auth option to authorize directly.)
# ブラウザでログインしてください
# 警告が表示されますが、ログインできるはずです。
Updating metadata cache: [=====================================] 100.00% 26s
# ここにフォルダ・ファイルの一覧が表示されます!!!!

21
10
5

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
21
10