3

I'm trying to get access to my google calendar on a raspberry pi. As the raspberry pi doesn't have a screen, I couldn't do the normal OAuth flow which involves opening up a browser window. Also doing OAuth is kind of overkill as it is only for personal use. Does anyone know some simpler way to authenticate? Thanks!

NoSegfault
  • 675
  • 1
  • 9
  • 14
  • 1
    For example, as a method, how about using service account? https://developers.google.com/identity/protocols/OAuth2ServiceAccount – Tanaike Jan 13 '19 at 23:13
  • 1
    It's fairly simple. See https://stackoverflow.com/questions/19766912/how-do-i-authorise-an-app-web-or-installed-without-user-intervention/19766913#19766913 – pinoyyid Jan 13 '19 at 23:46
  • Thanks! I'll take a look! – NoSegfault Jan 13 '19 at 23:52

1 Answers1

2

Google Calendar requires OAuth 2.0 authorization. As per the documentation no other methods are supported.

Your application must use OAuth 2.0 to authorize requests. No other authorization protocols are supported. If your application uses Google Sign-In, some aspects of authorization are handled for you.

About authorization protocols

Another option is to use a Service Account. However, this requires G Suite. If you have a G Suite domain, you can create a service account and then implement Domain-Wide Authority (delegation).

If you have a G Suite domain—if you use G Suite, for example—an administrator of the G Suite domain can authorize an application to access user data on behalf of users in the G Suite domain. For example, an application that uses the Google Calendar API to add events to the calendars of all users in a G Suite domain would use a service account to access the Google Calendar API on behalf of users. Authorizing a service account to access data on behalf of users in a domain is sometimes referred to as "delegating domain-wide authority" to a service account.

Delegating domain-wide authority to the service account

John Hanley
  • 74,467
  • 6
  • 95
  • 159