我正在使用oauth2(node.js和connect-oauth库)连接到google contacts API version 3.0。在Google Contacts API版本3.0上使用oauth2检索刷新标记
这样做,我得到这样的回应:
{ access_token : "...",
"token_typen": "Bearer",
"expires_in" : 3600,
"id_token": "..." }
我缺少用于令牌只要后者过期得到一个新的接入刷新令牌。
选项的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 } }
体交 “REDIRECT_URI = HTTP%3A%2F%2Flocalhost%2Foauth2callback & grant_type = authorization_code & CLIENT_ID =客户端ID & client_secret = CLIENTSECRET &类型= web_server &代码= 4 %2F3gbiESZTEOjiyFPLUhKfE_a_jr8Q”
注:我试图从similar question的请求post_body添加approval_prompt =力,但是这导致了n错误
{ statusCode: 400, data: '{\n "error" : "invalid_request"\n}' }
谢谢您的回答。不幸的是,这也不起作用。我收到一个错误:{statusCode:400,data:'{“error”:“invalid_request”}'}。 – forste 2012-04-17 16:29:43