AuthN | Java SDK | User Endpoints
User Endpoints
Get User (client token)
userinfo(String code)Retrieve the logged in user's token and information.
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.
ClientPasswordChangeResponse response = client.client().password().change(
"ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
"hunter2",
"My2n+Password");
Create User
create(UserCreateRequest request)Create a user.
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.
client.user().deleteByEmail("joe.user@email.com");
Delete User
deleteByID(String id)Delete a user by ID.
client.user().deleteByID("pui_xpkhwpnz2cmegsws737xbsqnmnuwtbm5");
Update user's settings
update(UserUpdateRequest request)Update user's settings.
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.
UserListRequest request =
new UserListRequest.Builder().build();
UserListResponse response = client.user().list(request);
Delete user authenticator
delete(UserAuthenticatorsDeleteRequest request)Delete user authenticator.
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.
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.
UserProfileGetResponse response =
client.user().profile().getByEmail("joe.user@email.com");
Get user - id
getByID(String id)Get user's information by id.
UserProfileGetResponse response =
client.user().profile().getByID("pui_xpkhwpnz2cmegsws737xbsqnmnuwtbm5");
Update user
update(UserProfileUpdateRequest request)Update user's information by identity or email.
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);