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 #

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());
}