f-f / gogolica

Auto-generated Google APIs for Clojure
Eclipse Public License 1.0
2 stars 0 forks source link

Handle auth #11

Closed f-f closed 6 years ago

f-f commented 6 years ago

Some methods require authentication/authorization, while some are open.

I have no idea how to do this yet, but the general API reference says that we should use Oauth2, so we should probably implement that.

f-f commented 6 years ago

Looks like we can skip for the moment the complicated OAuth2 consent screen, and use OAuth2 with Service Accounts, without user interaction. Unfortunately, this means implementing JWT signing: https://developers.google.com/identity/protocols/OAuth2ServiceAccount

f-f commented 6 years ago

Update: made progress with auth: now it's possible to get an OAuth2 token with the service account key. Needs:

  1. caching of the already authorized tokens for 1 hour
  2. wiring everything up in the generated code