authy-java icon indicating copy to clipboard operation
authy-java copied to clipboard

Invalid Token. Only digits accepted.

Open mikhail-idris opened this issue 11 years ago • 1 comments

The following exception is thrown when I attempted to verify the token that was sent via SMS.

com.authy.AuthyException: Invalid Token. Only digits accepted.

Take note that validating the token that was given by the application works fine.

I have double checked the inputs and the String inputs should be "convertible" to a number.

mikhail-idris avatar Aug 24 '15 11:08 mikhail-idris

Hi @mikhail-idris I could not reproduce the issue, could you provide example code?. However I've added a code below it should work with String which contains digits if you put String which contains characters it will raise the error you mention that's the behavior so you will need to catch this Exception.

  import com.authy.*;
  AuthyApiClient client = new AuthyApiClient("apiKey");
  Tokens tokens = client.getTokens();
  Users users = client.getUsers();
  int authyUserId = 0000;
  String verificationCode = "9309090";
  Token verification = tokens.verify(authyUserId, verificationCode);

moisesvw avatar Nov 18 '15 20:11 moisesvw