user645402
user645402

Reputation: 837

getting a google id and an access token from a google username/password

I am creating a headless service that I intend to use to access a third party API. To do this, I need to authorize myself with this third party API using a google access token. since I want this service to run in a headless fasion (i.e. no user input), I created a special account with Google and now I want to get the access token and google id using OAuth - the caveat is that this is a headless service, so I need to do this without the 'user' entering their username / password.

how do I do this?

Upvotes: 1

Views: 2987

Answers (1)

Miguel Andres
Miguel Andres

Reputation: 1430

Regarding your comment, you can get a refresh token through the web flow. Refresh tokens never expire (although the user can revoke them) and can be used to obtain access tokens as often as needed. See https://developers.google.com/accounts/docs/OAuth2WebServer for more info.

Upvotes: 2

Related Questions