1
간단한 예제 인 here에 이어 Google App Engine 1.7.5와 Python 2.5를 사용하여 그룹 설정 API로 그룹 설정을 가져 오려고했습니다. 이 내 애플리케이션 제목입니다 :서비스 계정이 있지만 자격 증명이 유효하지 않은 Google App Engine
application: {{APP_ID}}
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
script: main.py
내 main.py는 다음과 같다 :
def main():
application = webapp.WSGIApplication([('/', TestHandler)])
run_wsgi_app(application)
class TestHandler(webapp.RequestHandler):
"""Handles a request for the query page."""
def get(self):
self.response.out.write(Test())
def Test():
credentials = AppAssertionCredentials(scope='https://www.googleapis.com/auth/apps.groups.settings')
http = credentials.authorize(httplib2.Http(memcache))
service = build('groupssettings', 'v1', http=http)
group = service.groups().get(groupUniqueId='{{GROUP_ID}}').execute()
logging.error(group)
if __name__=="__main__":
main()
이 나에게 잘못된 자격 증명을 말하는 스택 트레이스입니다!
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\webapp\_webapp25.py", line 714, in __call__
handler.get(*groups)
File "D:\Projets\GS\main.py", line 26, in get
self.response.out.write(Test())
File "D:\Projets\GS\main.py", line 41, in Test
group = service.groups().get(groupUniqueId='{{GROUP_ID}}').execute()
File "D:\Projets\GS\oauth2client\util.py", line 132, in positional_wrapper
return wrapped(*args, **kwargs)
File "D:\Projets\GS\apiclient\http.py", line 723, in execute
raise HttpError(resp, content, uri=self.uri)
HttpError: <HttpError 401 when requesting https://www.googleapis.com/groups/v1/groups/{{GROUP_ID}}?alt=json returned "Invalid Credentials">
INFO 2014-11-21 15:51:45,423 dev_appserver.py:3104] "GET/HTTP/1.1" 500 -
INFO 2014-11-21 15:51:45,611 dev_appserver.py:3104] "GET /favicon.ico HTTP/1.1" 404 -
이 오류가 발생했거나 근본 원인에 대한 아이디어가있는 사람이 있습니까?
이미 콘솔에 GroupSettings API를 추가하고 권한을 부여했지만 내부에서 권한 CPanel을 수행하는 방법은 무엇입니까? 나는 동일한 범위에 {{APAP_ID} }@appspot.gserviceaccount.com을 승인하려했지만 URL에 호스트가 있어야한다고 말하지 않습니다. – Drwhite
예 -이 문제도 있습니다. GroupSettings API를 사용하면 아무런 효과가 없습니다. – Praxiteles
당신의 질문에서'{{GROUP_ID}}'은 당신이 얻으려는 그룹의 이메일 주소를 가리키고 있지만 질문에 대해 익명으로 만들었습니까? – Nick