Sm_PolicyApi_SetUserPasswordState()
Add or update a UserPasswordState object.
sm1252sp1
Add or update a UserPasswordState object.
If there is no PasswordState associated with the user, a new PasswordState will be created. Otherwise, the UserPasswordState will be updated.
Type
Password state function.
Syntax
int SM_EXTERN Sm_PolicyApi_SetUserPasswordState (void*pSessionHandle,const char*pszUserDirOid,const char*pszUserDN,Sm_PolicyApi_UserPasswordState_t*pPasswordStatebool bEmptyHistory);
Parameter | I/O | Description |
pSessionHandle
| I | A pointer to an internal Policy Management API data structure. The structure holds information about the administrator session and the client session. |
pszUserDirOid
| I | Unique object identifier that corresponds to a particular User Directory. |
pszUserDN
| I | Specifies the distinguished name of the user within the user directory. |
pPasswordState
| I/O | The user password state object. If this parameter changes the user directory setting for the last time the password was changed, and the password is reset outside of CA Single Sign-On , the password policy preventing password reuse may not work as expected.If this parameter is set to NULL, the function returns Sm_PolicyApi_Failure. |
bEmptyHistory
| I | Specifies whether this function should clear the existing password history. If this parameter is set to true, the field tLastPWChange field of structure Sm_PolicyApi_UserPasswordState_t is implicitly reset to zero. |
Returns
- Sm_PolicyApi_Success. The get operation was successful.
- Sm_PolicyApi_Failure. Generalized failure.
- Sm_PolicyApi_InvalidHandle. The session pointer is not valid.
- Sm_PolicyApi_BadArgument. The input password state pointer is NULL.
- Sm_PolicyApi_NoSession. The API user is not properly logged in.
- Sm_PolicyApi_InvalidOid. The unique id does not correspond to User Directory object.
- Sm_PolicyApi_UserDirNotFound. Failed to retrieve User Directory object from policy store.
- Sm_PolicyApi_ErrorUserDir. Invalid User Directory object or wrong user DN.
- Sm_PolicyApi_NoPrivilege. The caller does not have the proper privileges.