I am using auth0 sdk com.auth0:auth0:1.19.0
public void changePassword(String userId, String newPassword) {
AuthAPI auth = new AuthAPI(domain, managementClientId, managementClientSecret);
// Get Management API token
String managementToken = auth.requestToken("https://" + domain + "/api/v2/").execute().getAccessToken();
ManagementAPI managementAPI = new ManagementAPI(domain, managementToken);
// Change user password
UsersEntity usersEntity = managementAPI.users();
try {
User user = usersEntity.update(userId, new User().setPassword(newPassword));
System.out.println("Password changed successfully for user: " + user.getEmail());
} catch (APIException e) {
// Handle error
System.err.println("Failed to change password: " + e.getMessage());
}
with this code i am unable to change password
especially with this line
User user = usersEntity.update(userId, new User().setPassword(newPassword));