[英]Can't refresh my access_token
I've been trying for hours to get a new access token from the Google API but it kept throwing me a 400 error : bad request. 我已经尝试了好几个小时,以从Google API获取新的访问令牌,但是它不断抛出400错误:错误的请求。 Any idea ?
任何想法 ?
r = RestClient.post 'https://accounts.google.com/o/oauth2/token', :refresh_token => refresh_token, :client_id => client_id, :client_secret => client_secret, :grant_type => 'access_token'
EDIT : Do I need to force content-type ? 编辑:我需要强制内容类型吗? Do you have an alternative solution to RestClient ?
您是否有RestClient的替代解决方案?
grant_type
should be " refresh_token " and not " access_token " grant_type
应该是“ refresh_token ”,而不是“ access_token ”
Try this: 尝试这个:
RestClient.post 'https://accounts.google.com/o/oauth2/token', :refresh_token => refresh_token, :client_id => client_id, :client_secret => client_secret, :grant_type => 'refresh_token'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.