SDK
SDK Java v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

This SDK has been deprecated because of stability issues. It is not advised to use it in a production environment.

checkToken #

Checks a JWT Token's validity.

Signature #

TokenValidity checkToken(String);

Arguments #

ArgumentsTypeDescription
tokenStringthe token

Return #

A TokenValidity object which has:

NameTypeDescription
validbooleanTell if the token is valid or not
stateStringExplain why the token is invalid
expires_atBigIntegerTells when the token expires

Exceptions #

Throws a KuzzleException if there is an error. See how to handle error.

Usage #

try {
  String token = kuzzle.getAuth().login("local", "{\"username\":\"foo\",\"password\":\"bar\"}");
  TokenValidity res = kuzzle.getAuth().checkToken(token);
  if (res.getValid() == true)
    System.out.println("Success");
  else
    System.err.println(res.getState());
} catch (KuzzleException e) {
  System.err.println(e.getMessage());
}