繁体   English   中英

org.scribe.exceptions.OAuthException:响应正文不正确。 无法从中提取令牌和秘密:'令牌无效

[英]org.scribe.exceptions.OAuthException: Response body is incorrect. Can't extract token and secret from this: 'The token is invalid

OAuthService service = new ServiceBuilder()
                .provider(GoogleApi.class)
                .apiKey("198898816518.apps.googleusercontent.com")
                .apiSecret("hpvFCWHt6ZxWqO-DLwF062rO")
                .scope(SCOPE)
                .build();

        Token requestToken = null;

        requestToken = service.getRequestToken();

        System.out.println("authorize Scribe here:");
        Token token = new Token("oauth_token", "4/qGH3cNdzrdIIMmEsDMTRNhKD9z51");
        System.out.println(AUTHORIZE_URL + requestToken.getToken());
        System.out.println("paste the verifier");

              Verifier verifier = new Verifier("IWqonDH9RCtK0hwyZQlYOUCb");
                      // Trade the Request Token and Verfier for the Access Token

        Token accessToken = service.getAccessToken(token, verifier);

我收到了错误..

org.scribe.exceptions.OAuthException:响应正文不正确。 无法从中提取令牌和秘密:'令牌无效。

提前致谢....

我相信你可能正在使用scribe 1.3.0,因为我在做oauth时也遇到了这样的错误。 只需将其替换为最新版本,抄写1.3.1,你就可以了.......好像在1.3.0中有些问题......不确定是否完全违反了错误原因,但这对我有用。 你可以从这里下载: scribe 1.3.1

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM