We have a API call when creating a guest user to Force Password Reset, but user does not get a password change on their next subsequent login.
//Create User with guest role 109
URI createUserUri = userContext.createAuthenticatedUri("/d2l/api/lp/1.59/users/", "POST");
String screateUserUri = createUserUri.toString();
String createUserData = "{\n \"OrgDefinedId\": \"" + strEmail +"\",\n \"FirstName\": \"" + strFirstName + "\",\n \"MiddleName\": \"\",\n \"LastName\": \"" + strLastName +"\",\n \"ExternalEmail\": \"" + strEmail + "\",\n \"UserName\": \"" + strEmail + "\",\n \"RoleId\": \"109\",\n \"IsActive\": \"true\",\n \"SendCreationEmail\": \"false\"\n}";
try {
String createResult = postData(screateUserUri,createUserData, "POST");
} catch (Exception e1) {
e1.printStackTrace();
}
//Assign a temporary password and turn on ForcePasswordReset
URI updateUserUri = userContext.createAuthenticatedUri("/d2l/api/lp/1.59/users/"+userId+"/password", "PUT");
String supdateUserUri = updateUserUri.toString();
String updateData = "{\n \"Password\": \"" + strEmail + "\", \n \"ForcePasswordReset\": true \n}";
try {
String updateResult = postData(supdateUserUri,updateData, "PUT");
} catch (Exception e2) {
e2.printStackTrace();
}
In the D2L user configuration, the guest account was created by API call successfully with the option checked: Force password change on login.
What factors could cause the guest user login without password change prompted?
Thank you,
Phyllis