I am using oauth2 (node.js and the connect-oauth library) to connect to the google contacts API version 3.0.
Doing so, I get a response such as:
{ access_token : "...",
"token_typen": "Bearer",
"expires_in" : 3600,
"id_token": "..." }
I am missing the refresh token used to get a new access token as soon as the latter is expired.
options for oauth2
{ host: 'accounts.google.com',
port: 443,
path: '/o/oauth2/token',
method: 'POST',
headers:
{ 'Content-Type': 'application/x-www-form-urlencoded',
Host: 'accounts.google.com',
'Content-Length': 247 } }
post-body 'redirect_uri=http%3A%2F%2Flocalhost%2Foauth2callback&grant_type=authorization_code&client_id=CLIENTID&client_secret=CLIENTSECRET&type=web_server&code=4%2F3gbiESZTEOjiyFPLUhKfE_a_jr8Q'
NOTE: I tried to add approval_prompt=force from a similar question to the request-post_body but this resulted in an Error
{ statusCode: 400, data: '{\n "error" : "invalid_request"\n}' }