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 #

Copied to clipboard!
TokenValidity checkToken(String);

Arguments #

Arguments Type Description
token String the token

Return #

A TokenValidity object which has:

Name Type Description
valid boolean Tell if the token is valid or not
state String Explain why the token is invalid
expires_at BigInteger Tells when the token expires

Exceptions #

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

Usage #

Copied to clipboard!
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());
}