getCurrentUser

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

Signature

Copied to clipboard!
public User getCurrentUser();

Return

A User object with setters and getters containing:

Property Type Description
id String The user ID
content String The user content
profileIds String[] An array containing the profile ids

Usage

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