authy-java
authy-java copied to clipboard
Invalid Token. Only digits accepted.
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.
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);