我正在调用这个方法:
GoogleTokenResponse accessResposnse = new GoogleAuthorizationCodeTokenRequest(httpTransport, jsonFactory,
clientId, clientSecret, authorizationUrl, redirectUrl).execute();
其中授权网址是:
String authorizationUrl = new GoogleAuthorizationCodeRequestUrl(clientId, redirectUrl, scope).setAccessType("offline").setState("security_token").setResponseTypes(responseType).build();
但这给了我错误:
com.google.api.client.auth.oauth2.TokenResponseException: 400 错误请求 { "error" : "invalid_grant" }
我错过了中间的任何步骤吗?另外,如果我尝试调用此函数:
AuthorizationCodeResponseUrl authoUrl = new AuthorizationCodeResponseUrl(redirectUrl);
它在扔java.lang.IllegalArgumentException