我正在尝试获取访问令牌以使用 Google Web Play API,但它不起作用,并且不会提供有用的错误消息,而且 Google 不提供一点支持。
https://developers.google.com/android-publisher/authorization
Client ID for web applications
Client ID: 37625491467222.apps.googleusercontent.com
Email address: 37625491467222@developer.gserviceaccount.com
Client secret: XB5gwFt8w29Fs34540gr9urEGEmUHCLI
Redirect URIs: http://www.kizbit.com/oauth2callback
JavaScript origins: http://www.kizbit.com
[root@308321 ~]# cat authcode.txt grant_type=authorization_code&code=4%2FIAoP7JxYfe82KsuUwQRWQw2na_vreOM.MtjvGJqCG3IYshQV0ieZDArkfr1icAI&client_id=37625491467222.apps.googleusercontent.com&client_secret=XB5gwFt8w29Fs34540gr9urEGEmUHCLI&redirect_uri=http%3A%2F%2Fwww.kizbit.com%2Foauth2callback
[root@308321 ~]# wget -S --post-file=authcode.txt https://accounts.google.com/o/oauth2/token
--2012-06-28 01:08:37-- https://accounts.google.com/o/oauth2/token
Resolving accounts.google.com... 2001:4860:b007::54, 74.125.142.84
Connecting to accounts.google.com|2001:4860:b007::54|:443... connected.
HTTP request sent, awaiting response...
HTTP/1.0 400 Bad Request
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Date: Thu, 28 Jun 2012 05:08:40 GMT
Content-Type: application/json
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
2012-06-28 01:08:
37 ERROR 400: Bad Request.
我知道您不应该提供钥匙,但这没关系,因为它不起作用!
刷新令牌也不起作用。
不编码文件也不起作用:
[root@308321 ~]# cat authcode2.txt
grant_type=authorization_code
code=4/IAoP7JxYfe82KsuUwQRWQw2na_vreOM.MtjvGJqCG3IYshQV0ieZDArkfr1icAI
client_id=37625491467222.apps.googleusercontent.com
client_secret=XB5gwFt8w29Fs34540gr9urEGEmUHCLI
redirect_uri=http://www.kizbit.com/oauth2callback
[root@308321 ~]# wget -S --post-file=authcode2.txt https://accounts.google.com/o/oauth2/token
--2012-06-28 01:33:44-- https://accounts.google.com/o/oauth2/token
Resolving accounts.google.com... 2001:4860:b007::54, 74.125.142.84
Connecting to accounts.google.com|2001:4860:b007::54|:443... connected.
HTTP request sent, awaiting response...
HTTP/1.0 400 Bad Request
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Date: Thu, 28 Jun 2012 05:33:47 GMT
Content-Type: application/json
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
2012-06-28 01:33:44 ERROR 400: Bad Request.