1

ridiculously simple question that i just can't seem to find any answer to:

i have, via oauth2 3 legged authentication, the userId + accessToken + refreshToken to access a google user's calendar scope.

now, i want to list all of that user's calendars.

the google calendar api reference (https://developers.google.com/google-apps/calendar/v3/reference/) talks about calendarList, which sounds great... but...

https://www.googleapis.com/calendar/v3/users/me/calendarList

this is 3 legged oauth, there is no browser with a cookie storing some kind of google identifier for the "me" to work with. i need to specify the userId, the email account - something to identify the user whose calendars i want to list!

is there no way to do this most trivial basic use case?

this question (OAuth2/Google CalDAV - List of calendars for user) is a duplicate, and the self-answered comment link describes a solution based on v2 of calendar with something called propfind and dav, of which i know nothing. really? no rest?

tsk tsk google. tsk.

Community
  • 1
  • 1
nathan g
  • 858
  • 9
  • 17

1 Answers1

1

well it really is as trivial and stupid as i thought it should be: the access_token contains the user information in it... sending the access_token in the Authrization: Bearer header does the trick.

nathan g
  • 858
  • 9
  • 17
  • Hi @nathan, can you pls paste a snippet of how you've solved the problem? Can't figure out how I can get an end-user to allow my server side to access end-user's calendar if I don't have a web oauth flow (my backend is a chatbot so doesn't have UI to prompt the end-user). Thanks! – Konstantin Dec 21 '20 at 11:37