私はgoogle-oauth-javaを使用していますが、私の人生を本当に複雑にしているのは、使用しようとすると、コード 200 ではなくコード 302 を返すリクエストのためOAuthClient.invoke()
に頻繁にOAuthProblemException
スローされることです。そのため、コードを書き直して代わりにinvoke
使用していることに気付きましOAuthClient.access()
た。followRedirect
ある種の設定が欠けているのではないかと思っていますか?ドキュメントは存在せず、例もあまり役に立ちません。誰か助けてくれませんか?
説明するためのスニペットOAuthClient
を次に示します
public OAuthMessage invoke(OAuthMessage request, ParameterStyle style)
throws IOException, OAuthException {
OAuthResponseMessage response = access(request, style);
if ((response.getHttpResponse().getStatusCode() / 100) != 2) {
OAuthProblemException problem = response.toOAuthProblemException();
try {
problem.setParameter(OAuthProblemException.SIGNATURE_BASE_STRING,
OAuthSignatureMethod.getBaseString(request));
} catch (Exception ignored) {
}
throw problem;
}
return response;
}