Google 드라이브 API를 사용하여 Google 드라이브의 파일을 나열하는 AppEngine 응용 프로그램을 개발 중입니다. 내 사용자 중 한 명이 내 앱을 실행하려고하면 500 오류가 발생합니다.Google 드라이브 API에 액세스 할 때 '잘못된 자격증 명'이 표시됩니다.
HttpError : https://www.googleapis.com/drive/v2/files?q=%27[ID sanitized] % 27 + in + parents & alt = json & maxResults = 5 "잘못된 자격증 명">
코드는 특정 Google 드라이브 폴더에서 파일을 가져옵니다. 폴더 및 파일은 사용자와 공유되며 앱은 Google 드라이브 API를 사용할 권한이 있습니다.
어느 시점에서 나는 처음부터 시작해야한다고 생각했기 때문에 해당 사용자의 계정에서 권한을 취소했습니다. 차이를 만드는 것 같지 않았지만 지금은 내 애플 리케이션이 더 이상 특정 사용자에게 인증을 요청하지 않는 것으로 보이는 부상에 대한 모욕을 추가합니다.
아무 때 나 추천 할만한 사람이 있습니까? 내 코드는 파이썬 및 권한 부여를 처리 (oauth_required 포함) 데코레이터에 대한 구글의 API 클라이언트를 사용
CLIENT_SECRETS = os.path.join(os.path.dirname(__file__), 'client_secrets.json')
MISSING_CLIENT_SECRETS_MESSAGE = """
<h1>Warning: Please configure OAuth 2.0</h1>
<p>
To make this sample run you will need to populate the client_secrets.json file
found at:
</p>
<p>
<code>%s</code>.
</p>
<p>with information found on the <a
href="https://code.google.com/apis/console">APIs Console</a>.
</p>
""" % CLIENT_SECRETS
http = httplib2.Http(memcache)
service = build("plus", "v1", http=http)
files_service = build("drive", "v2", http=http)
decorator = oauth2decorator_from_clientsecrets(
CLIENT_SECRETS,
scope='https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/drive.readonly',
message=MISSING_CLIENT_SECRETS_MESSAGE)
[...]
class MainPage(webapp2.RequestHandler):
@decorator.oauth_required
def get(self):
[...]
try:
kb_param = {}
kb_param["maxResults"] = 5
kb_param["q"] = "'[sanitized]' in parents"
kb_files = files_service.files().list(**kb_param).execute(http=http)
template_values = {
'kb_files': kb_files["items"]
}
어떤 통찰력이 크게 감사하겠습니다 :)
감사합니다! 릭.