Google OAuth を使用して認証しようとしていますが、チュートリアルに従うのに少し問題があります。
これが私の現在の設定です:
FLOW = OAuth2WebServerFlow(
client_id='67490467925.apps.googleusercontent.com',
client_secret='K1tkrPK97B2W16ZGY',
scope='https://www.googleapis.com/auth/calendar',
user_agent='Real_Hub/1.0',
redirect_uri='http://127.0.0.1:8000/',)
storage = Storage('calendar.dat')
credentials = storage.get()
if credentials is None or credentials.invalid == True:
auth_uri = FLOW.step1_get_authorize_url()
return auth_uri
else:
http = httplib2.Http()
http = credentials.authorize(http)
service = build(serviceName='calendar', version='v3', http=http,
developerKey='AIzaSyCBGjIQ2uNbThW_2oMO9P-Ufb8kc')
return service
#End OAUTH...
「code」変数をどこに置くべきかcredentials = flow.step2_exchange(code)
、またどのように取得すればよいかわかりません。storage.put(credentials)
API では、リダイレクト URL からと表示されます。しかし、私はこれを行う方法に従いません。