Skip to main content

AuthN | Java SDK | User Endpoints

User Endpoints

Get User (client token)

userinfo(String code)

Retrieve the logged in user's token and information.

required parameters

String

Login code returned by the login callback

Response Object

ClientUserinfoResponse

ClientUserinfoResponse

 ClientUserinfoResponse response = client.client().userinfo("pmc_d6chl6qulpn3it34oerwm3cqwsjd6dxw");

Change a user's password

change(String token, String oldPassword, String newPassword)

Change a user's password given the current password.

required parameters

String

A user token value

String
String

Response Object

ClientPasswordChangeResponse

ClientPasswordChangeResponse

 ClientPasswordChangeResponse response = client.client().password().change(
 	"ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
 	"hunter2",
 	"My2n+Password");

Create User

create(UserCreateRequest request)

Create a user.

required parameters

UserCreateRequest

Response Object

UserCreateResponse

UserCreateResponse

 Profile profile = new Profile();
 profile.put("first_name", "Joe");
 profile.put("last_name", "User");

 UserCreateRequest request = new UserCreateRequest.Builder(
 	"joe.user@email.com",
 	profile
 ).build();

 UserCreateResponse response = client.user().create(request);

Delete User

deleteByEmail(String email)

Delete a user by email address.

required parameters

String

An email address

Response Object

UserDeleteResponse

UserDeleteResponse

 client.user().deleteByEmail("joe.user@email.com");

Delete User

deleteByID(String id)

Delete a user by ID.

required parameters

String

The identity of a user or a service

Response Object

UserDeleteResponse

UserDeleteResponse

 client.user().deleteByID("pui_xpkhwpnz2cmegsws737xbsqnmnuwtbm5");

Update user's settings

update(UserUpdateRequest request)

Update user's settings.

required parameters

UserUpdateRequest

Response Object

UserUpdateResponse

UserUpdateResponse

 UserUpdateRequest request = new UserUpdateRequest.Builder()
 	.setEmail("joe.user@email.com")
 	.setDisabled(true)
 	.build();

 UserUpdateResponse response = client.user().update(request);

List Users

list(UserListRequest request)

Look up users by scopes.

required parameters

UserListRequest

Response Object

UserListResponse

UserListResponse

 UserListRequest request =
 	new UserListRequest.Builder().build();

 UserListResponse response = client.user().list(request);

Delete user authenticator

delete(UserAuthenticatorsDeleteRequest request)

Delete user authenticator.

required parameters

UserAuthenticatorsDeleteRequest

Request parameters.

Response Object

UserAuthenticatorsDeleteResponse

An empty object.

 UserAuthenticatorsDeleteRequest request =
 	new UserAuthenticatorsDeleteRequest
 		.Builder("pau_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a")
 		.setID("pui_xpkhwpnz2cmegsws737xbsqnmnuwtbm5")
 		.build();

 client.user().authenticators().delete(request);

Get user authenticators

list(UserAuthenticatorsListRequest request)

Get user authenticators.

required parameters

UserAuthenticatorsListRequest

Request parameters.

Response Object

UserAuthenticatorsListResponse

User's authenticators.

 UserAuthenticatorsListRequest request =
 	new UserAuthenticatorsListRequest
 		.Builder()
 		.setID("pui_xpkhwpnz2cmegsws737xbsqnmnuwtbm5")
 		.build();

 UserAuthenticatorsListResponse response =
 	client.user().authenticators.list(request);

Get user - email

getByEmail(String email)

Get user's information by email.

required parameters

String

Response Object

UserProfileGetResponse

UserProfileGetResponse

 UserProfileGetResponse response =
 	client.user().profile().getByEmail("joe.user@email.com");

Get user - id

getByID(String id)

Get user's information by id.

required parameters

String

The identity of a user or a service

Response Object

UserProfileGetResponse

UserProfileGetResponse

 UserProfileGetResponse response =
 	client.user().profile().getByID("pui_xpkhwpnz2cmegsws737xbsqnmnuwtbm5");

Update user

update(UserProfileUpdateRequest request)

Update user's information by identity or email.

required parameters

UserProfileUpdateRequest

Response Object

UserProfileUpdateResponse

UserProfileUpdateResponse

 Profile updatedProfile = new Profile();
 updatedProfile.put("country", "Argentina");

 UserProfileUpdateRequest request =
 	new UserProfileUpdateRequest
 		.Builder(updatedProfile)
 		.setID("pui_xpkhwpnz2cmegsws737xbsqnmnuwtbm5")
 		.build();

 UserProfileUpdateResponse response =
 	client.user().profile().update(request);