Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat to expect when the Verifier is wrong
    primarykey
    data
    text
    <p>Let me explain my scenario first. I'm using Scribe to connect via Oauth to an API not directly supported by Scribe. That said, the server I'm connecting to requires to enter a 4 digit number as the final step for being able to create the accessToken.</p> <p>While this is working great, when the user inputs the 4 digits wrong, the app stays running forever, no error or excepction is thrown (to my understanding). This is the code I'm using:</p> <pre><code>//verifierString has the 4-digit number verifier = new Verifier(verifierString); Logger.debug("Trading the Request Token for an Access Token..."); accessToken = service.getAccessToken(requestToken, verifier); </code></pre> <p>App stays in getAccessToken forever. I wonder if there is a way to control this, since it's very possible that users input the 4 digit wrong. I've checked the code for getAccessToken, Oauth 1.0 since it's the one I'm using:</p> <pre><code>public Token getAccessToken(Token requestToken, Verifier verifier) { config.log("obtaining access token from " + api.getAccessTokenEndpoint()); OAuthRequest request = new OAuthRequest(api.getAccessTokenVerb(), api.getAccessTokenEndpoint()); request.addOAuthParameter(OAuthConstants.TOKEN, requestToken.getToken()); request.addOAuthParameter(OAuthConstants.VERIFIER, verifier.getValue()); config.log("setting token to: " + requestToken + " and verifier to: " + verifier); addOAuthParams(request, requestToken); appendSignature(request); Response response = request.send(); return api.getAccessTokenExtractor().extract(response.getBody()); } </code></pre> <p>It only seems that send() throws a RuntimeException, but not sure if catching it from my code is the right way to do it....any suggestions?</p> <p>Thanks ! Alex</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload