简体   繁体   中英

Google API Service Account - Can't Access Private Data

Trying to access my personal calendar data using a service account.

I've gone through the setup for creating a service account (with owner permissions). Using NodeJS, I've successfully made requests to my public calendar, but not my private calendars. ( the same result using googleapis and google-OAuth-jwt packages)

Everything that I've searched shows that I need to give "domain-wide authority", BUT, I do not have a G Suite account, so I don't believe this applies to me.

So the question is, can one access their own personal calendar data using a service account? What might I be missing?

Answer in comments, thanks to abielita . Link to answer .

Remember service accounts are not you. The service account has its own Google calendar account so if you are trying to read one of your personal calendars you are going to have to share it with the service account.

Shared the calendar with my service account.

You may refer with this SO post . It stated that the service account has its on Google calendar account so if you are trying to read one of your personal calendars, you are going to share it with the service account. You can check the example given using the Json service account key file .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM