[[PageOutline]] = setup project = * https://console.developers.google.com/ からプロジェクトを作成し、必要なAPIを有効にしたうえでOAuthのクライアントIDとクライアントシークレットを作成する * 自分で作成したプロジェクトのクライアントIDを用いることで、APIの発行状況やエラー発生件数などがダッシュボードから確認できるようになる 1. 初めてダッシュボードにアクセスした際には、利用規約への同意が求められる[[br]][[Image(oauth-01.png,33%)]] [[Image(oauth-02.png,33%)]] 2. プロジェクトの新規作成[[br]][[Image(oauth-03.png,33%)]] [[Image(oauth-04.png,33%)]] 3. 使用するAPIの有効化[[br]][[Image(oauth-05.png,33%)]] [[Image(oauth-06.png,33%)]] 4. 認証情報の作成[[br]][[Image(oauth-07.png,33%)]] [[Image(oauth-08.png,33%)]] 5. OAuth認証時の同意画面に表示する情報の設定[[br]][[Image(oauth-09.png,33%)]] [[Image(oauth-10.png,33%)]] * サービス名は「My OCAMLDrive」としている 6. アプリケーションの種類は「その他」とする[[br]][[Image(oauth-11.png,33%)]] 7. クライアントIDが生成され、表示もしくはjson形式でダウンロードできるようになる[[br]][[Image(oauth-12.png,33%)]] {{{ {"installed":{"client_id":"732618592028-28no107k9v98trf6meb8eegdpvjlr53o.apps.googleusercontent.com", "project_id":"fabled-frame-162115", "auth_uri":"https://accounts.google.com/o/oauth2/auth", "token_uri":"https://accounts.google.com/o/oauth2/token", "auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs", "client_secret":"ndaIX_3FQqHssFDwUAwOZdpi", "redirect_uris":["urn:ietf:wg:oauth:2.0:oob", "http://localhost"]}} }}} 8. このクライアントIDとシークレットを用いて認証要求を行うと、以下のように表示される[[br]][[Image(oauth-14.png,33%)]] = aur:google-drive-ocamlfuse = 1. デフォルトでは作者 {{{alessandro.strada@gmail.com}}} が用意したクライアントIDが用いられる[[br]][[Image(gdocamlfuse-1.png,33%)]] 2. 認証画面[[br]][[Image(gdocamlfuse-2.png,33%)]] [[Image(gdocamlfuse-3.png,33%)]] 3. 「アカウントにアクセスできるアプリ」から確認できる[[br]][[Image(gdocamlfuse-4.png,33%)]] = aur:gdrivefs = * 作者が用意したクレデンシャルが埋め込まれており、コード書き換え以外に変更する手段が存在しない * gdrivefs 0.14.8-2に対するパッチ * PKGBUILD.diff {{{#!diff diff --git a/PKGBUILD b/PKGBUILD index dec95ef..2af649c 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -28,6 +28,9 @@ build() { # Fix for oauth2client.util library patch -p1 < ../../issue_166.patch + # change api_credentials + patch -p1 < ../../cred.patch + python2 setup.py build } }}} * cred.patch {{{#!diff diff --git a/gdrivefs/conf.py b/gdrivefs/conf.py index 5310a3d..1496df3 100644 --- a/gdrivefs/conf.py +++ b/gdrivefs/conf.py @@ -11,8 +11,8 @@ class Conf(object): """Manages options.""" api_credentials = { - "web": { "client_id": "1056816309698.apps.googleusercontent.com", - "client_secret": "R7FJFlbtWXgUoG3ZjIAWUAzv", + "web": { "client_id": "564155291697-r72paq515fukt1uoc0bjofjl9fvsoerb.apps.googleusercontent.com", + "client_secret": "WVcC9DJTJzLdbjByhMJmwA68", "redirect_uris": [], "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://accounts.google.com/o/oauth2/token" }}}