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.

getCurrentUser #

Returns the profile object for the user linked to the JSON Web Token, provided in the query or the Authorization header.

Signature #

public User getCurrentUser();

Return #

A User object with setters and getters containing:

PropertyTypeDescription
idStringThe user ID
contentStringThe user content
profileIdsString[]An array containing the profile ids

Usage #

try {
  kuzzle.getAuth().login("local", "{\"username\":\"foo\",\"password\":\"bar\"}");    
  kuzzle.getAuth().getCurrentUser();
  System.out.println("Success");
} catch (KuzzleException e) {
  System.err.println(e.getMessage());
}