Java com.google.api.client.auth.oauth2.TokenResponseException:400错误请求
我将此方法称为:Java com.google.api.client.auth.oauth2.TokenResponseException:400错误请求,java,google-client,google-shopping-api,Java,Google Client,Google Shopping Api,我将此方法称为: GoogleTokenResponse accessResposnse = new GoogleAuthorizationCodeTokenRequest(httpTransport, jsonFactory, clientId, clientSecret, authorizationUrl, redirectUrl).execute(); 其中authorizationUrl为: String authorizationUrl = new G
GoogleTokenResponse accessResposnse = new GoogleAuthorizationCodeTokenRequest(httpTransport, jsonFactory,
clientId, clientSecret, authorizationUrl, redirectUrl).execute();
其中authorizationUrl为:
String authorizationUrl = new GoogleAuthorizationCodeRequestUrl(clientId, redirectUrl, scope).setAccessType("offline").setState("security_token").setResponseTypes(responseType).build();
但这给了我一个错误:
com.google.api.client.auth.oauth2.TokenResponseException:400错误请求
{
错误:授权无效
}
我是否错过了中间的任何一步?
如果我试图调用此函数:
AuthorizationCodeResponseUrl authoUrl = new AuthorizationCodeResponseUrl(redirectUrl);
它抛出了java.lang.IllegalArgumentException可能是您的刷新令牌过期了。。您正在尝试使用过期的刷新令牌刷新访问令牌,还是使用过期的刷新令牌进行api调用?-如果是这样,您需要让您的用户重新进行身份验证