Org.scribe.exceptions.OAuthException: The response body is incorrect. Unable to extract token and secret from this: "Invalid token

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); 

I got an error.

org.scribe.exceptions.OAuthException: response body is incorrect. Unable to extract token and secret from this: "Invalid token.

thanks in advance....

+4
source share
1 answer

I believe that you can use scribe 1.3.0, as I also have such an error when I do oauth. Just replace it with the latest version, scribe 1.3.1, and you will be fine .... It seems that something happened in 1.3.0 ... I'm not sure exactly what the cause of the error is, but it worked for me. You can download here: scribe 1.3.1

+1
source

Source: https://habr.com/ru/post/1391632/


All Articles