- 追加された行はこの色です。
- 削除された行はこの色です。
-GoogleAPIについてまとめ
*公式情報ページ [#se492ab0]
|API一覧|https://developers.google.com/apis-explorer/#p/|
|ConsoleのAPI設定TOP|https://console.developers.google.com/apis/credentials|
|Developer Console|https://console.developers.google.com/cloud-resource-manager?pli=1&authuser=1&creatingProject=true|
**GmailAPI [#ia3b7781]
-https://github.com/google/mail-importer
*認証フローをまとめてみた [#d6ac09b6]
**事前準備 [#mfca6a80]
-APIの有効化
-OAuth2.0クライアントアカウントの作成(クライアントIDが重要)
**Googleアカウントによる認証をへる [#x3fb9a5f]
https://accounts.google.com/o/oauth2/auth?client_id={クライアントID}&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https://www.googleapis.com/auth/gmail.readonly&response_type=code&approval_prompt=force&access_type=offline
**上記画面で認証した後にrefresh_tokenを得る [#m7273025]
*OAuth2.0の解説。ここが一番詳しいかな [#ma4bc272]
https://himakan.net/websites/how_to_google_oauth
-Gmailの認証もOAuth2.0対応じゃない場合は安全性の低いアプリとみなされてしまう。
*Developer Console [#c4ed5562]
*Service Accountを利用したアクセスについて [#td025a55]
-FireBaseで使ったものの情報が非常に少ない!公式情報としては下記の通り。
https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority
-Google Play APIでも使ってた
https://github.com/googlesamples/android-play-publisher-api/blob/master/v2/java/src/com/google/play/developerapi/samples/AndroidPublisherHelper.java
-使って見た事例
http://www.yoheim.net/blog.php?q=20160411
*API認証周り [#lc49f6f6]
サービスアカウント経由であれば秘密鍵JSONを利用し、OAuth2.0であればClientID/KEYを使う(リダイレクトURLなしを作成するにはその他を選択する)
**用語集 [#k9021d24]
|CLIENT ID|OAuth 2.0 クライアントID|
|CLIENT KEY|OAuth 2.0 クライアントパスワード|
*Google Play Console [#ga9aac43]
https://developer.android.com/google/play/developer-api.html#subscriptions_api_overview