user2287359
user2287359

Reputation: 509

Google Calendar API request is denied for scope https://www.googleapis.com/auth/calendar.app.created

My app needs to create a Google Calendar and manage events in it for users. Google API Console allows to create a consent form for this scope:

https://www.googleapis.com/auth/calendar.app.created

It is supposed to allow creation of secondary calendars and events in those calendars. Description reads:

Make secondary Google calendars, and see, create, change, and delete events on them

However, after a user gives permission through the consent form etc, I am getting PERMISSION_DENIED when I try to create a calendar (I am using the REST api https://www.googleapis.com/calendar/v3/calendars)

{
  "error": {
    "code": 403,
    "message": "Request had insufficient authentication scopes.",
    "errors": [
      {
        "message": "Insufficient Permission",
        "domain": "global",
        "reason": "insufficientPermissions"
      }
    ],
    "status": "PERMISSION_DENIED"
  }
}

My code and the rest of the plumbing (authorization code, access token etc) works because if I use this scope:

https://www.googleapis.com/auth/calendar

I am able to create the calendar.

So, anybody knows if https://www.googleapis.com/auth/calendar.app.created is deprecated or something? It is not listed in the V3 calendar documentation but I was hopping that it continue to work. I hate to ask the user for full permission to all calendars since I only want to create and access a secondary calendar and that scope supposed to do exactly what I need.

Thoughts?

Upvotes: 5

Views: 3276

Answers (2)

CurtChan
CurtChan

Reputation: 31

https://www.googleapis.com/auth/calendar.app.created might not seem as valid scope - but works for me. Successfully could create new calendar with that scope, then manage events within it, and calendar itself appears on list of calendars in calendar.google.com

Can't really help much without knowing exactly the flow you have on creating and executing requests to google. Also keep in mind it worked for me with server side app. Using latest library provided by google for PHP.

Upvotes: 3

ziganotschka
ziganotschka

Reputation: 26796

CONCLUSION

Unfortunately https://www.googleapis.com/auth/calendar.app.created is not a valid scope, the acceptance of this scope on OAuth2 playground is a bug.

Upvotes: 2

Related Questions