Why is Google Calendar API (oauth2) responding with 'Insufficient Permission'?

后端 未结 8 1304
萌比男神i
萌比男神i 2020-12-01 17:42

I\'m doing a get request to the following URL (with {id} replaced with the id from the web interface):

https://www.googleapis.com/calendar/v3/calendars/{id}
         


        
相关标签:
8条回答
  • 2020-12-01 18:24

    I had the same issue while I was trying to add an event in my google calendar. How I finally fixed this :

    • delete my file 'credentials.json'
    • launch a Python program which looks like the Google's quickstart program with written in " SCOPES = 'https://www.googleapis.com/auth/calendar' ". This program was the only solution that worked for me. Launch my django command to call my real work did not work for me. But this fixed my permission problem.

    Then, it opens your browser and google asks your permission to manage your calendar and create a new 'credentials.json' in your repertory.

    0 讨论(0)
  • 2020-12-01 18:32

    Add scope for calendar visit calendar api and check access configuration

    https://www.googleapis.com/auth/calendar
    https://www.googleapis.com/auth/calendar.readonly
    
    0 讨论(0)
  • 2020-12-01 18:32

    I also face same issue when add or edit event. And after some googling, I found that, one scope will give you all permission -

    https://www.googleapis.com/auth/calendar
    
    0 讨论(0)
  • 2020-12-01 18:33

    To fix, I revoked access to the app at https://accounts.google.com/IssuedAuthSubTokens and retried after which, I was able to access the API correctly.

    Despite having the scope in the list, and the scope showing up on Google's OAuth2 grant page, the additional scope wasn't granted.

    0 讨论(0)
  • 2020-12-01 18:36

    I would double-check the scope is included - I've seen that exact message when I've requested the wrong scope. Visiting https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=xxxxxx is a good way to verify.

    Assuming that checks out, make sure that the user that you have the access token for has permission to view the calendar that you're trying to access. "Gears" icon -> "Settings" -> "Calendars" -> (select calendar) -> "Share this calendar"

    0 讨论(0)
  • 2020-12-01 18:36

    I had to include the Google Plus scope in order to have sufficent permission to access a calendar:

    So my scope ended up looking like this:

    'https://www.googleapis.com/auth/calendar', 'https://www.googleapis.com/auth/calendar.readonly', 'https://www.googleapis.com/auth/plus.login'

    0 讨论(0)
提交回复
热议问题