paper2 / Memory-Tweet-Bot

Memory Tweet Bot.
Apache License 2.0
0 stars 0 forks source link

Error: Token has been expired or revoked. #1

Open paper2 opened 1 year ago

paper2 commented 1 year ago

概要

OAuthのトークンリフレッシュに失敗する。

google.auth.exceptions.RefreshError: ('invalid_grant: Token has been expired or revoked.', {'error': 'invalid_grant', 'error_description': 'Token has been expired or revoked.'})

原因

背景

paper2 commented 1 year ago

方針

検討内容メモ

認証方法の検討

大きく以下3種類の認証方法が用意されている。それぞれで利用できるか検討した内容をメモする。

API キー

googleapiclient.errors.HttpError: <HttpError 401 when requesting https://photoslibrary.googleapis.com/v1/mediaItems:search?key=Axxxxxxt=json returned "API keys are not supported by this API. Expected OAuth2 access token or other authentication credentials that assert a principal. See https://cloud.google.com/docs/authentication". Details: "[{'@type': 'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'CREDENTIALS_MISSING', 'domain': 'googleapis.com', 'metadata': {'method': 'google.photos.library.v1.PhotosLibrary.SearchMediaItems', 'service': 'photoslibrary.googleapis.com'}}]">

OAuth 2.0

サービスアカウント