CheckToken #
Checks an authentication token's validity.
Arguments #
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 #
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();
Edit this page on Github(opens new window)