SDK
SDK Java v3.x
2

This SDK is deprecated. We recommend to use the Kuzzle SDK-JVM.
A migration guide is available here

CheckToken #

Checks an authentication token's validity.

Arguments #

Copied to clipboard!
public CompletableFuture<ConcurrentHashMap<String, Object>> checkToken(final String token)
  throws NotConnectedException, InternalException
Argument Type Description
token
String
Authentication token

Return #

A ConcurrentHashMap which has the following properties:

Property Type Description
valid
boolean
Token validity
state
String
Explain why the token is invalid
expires_at
int
Token expiration timestamp

Usage #

Copied to clipboard!
ConcurrentHashMap<String, Object> credentials = new ConcurrentHashMap<>();
credentials.put("username", "foo");
credentials.put("password", "bar");
ConcurrentHashMap<String, Object> response = kuzzle.getAuthController().login("local", credentials).get();
ConcurrentHashMap<String, Object> responseToken = kuzzle.getAuthController().checkToken(response.get("jwt").toString()).get();