Google Calendar API v3 - How to obtain a refresh token (Python)

后端 未结 4 867
离开以前
离开以前 2020-12-29 06:51

I am trying to write a Django app which creates events in a specific Google calendar. So far I have been successful. There is only a little problem:

I don\'t

4条回答
  •  旧巷少年郎
    2020-12-29 07:33

    The answers seems to be deprecated as of 2017-06-16.

    • approval_prompt is deprecated
    • prompt=force is not valid

    Here is a working example:

    from oauth2client.client import OAuth2WebServerFlow
    
    flow = OAuth2WebServerFlow(
        client_id=CLIEN_ID,
        client_secret=CLIENT_SECRET,
        scope=SCOPES,
        redirect_uri='http://localhost/gdrive_auth',
        access_type='offline',
        prompt='consent',
    )
    
    print(flow.step1_get_authorize_url())
    

提交回复
热议问题