Sm_AgentApi_ChangePassword()
Changes a user’s password. The resulting attributes plus the reason code from the session object are used to construct the correct password services redirect.
casso126
Changes a user’s password. The resulting attributes plus the reason code from the session object are used to construct the correct password services redirect.
Syntax
int SM_EXTERN Sm_AgentApi_ChangePassword (const void* pHandle,const char* lpszClientIpAddr,const char* lpszNewPassword,const char* pszTokenValue,const Sm_AgentApiResourceContext_t* pResourceContext,const Sm_AgentApi_Realm_t* pRealm,const Sm_AgentApi_UserCredentials_t* pUserCredentials,Sm_AgentApi_Session_t* pSession,long * numAttributes,Sm_AgentApi_Attribute_t** ppAttributes);
Parameter | I/O | Description |
pHandle
| I | Agent API session handle returned in parameter ppHandle of Sm_AgentApi_Init(). |
lpszClientIpAddr
| I | The IP address of the client asking for the resource. This parameter is optional. If the client IP begins with a star (*), the Policy Server logs the IP address but does not validate it against a session specification. |
lpszNewPassword
| I | The new password (string) to which the user wants to change. |
pszTokenValue
| I | The token that is exchanged between the Policy Server and the Web Agent in the case of a Password Services redirect. Use this parameter to send to the Policy Server an extracted SMTOKEN from the ppAttributes (returned by Sm_AgentApi_ChangePassword()). This value can be NULL if the nChallengeReason value of the pUserCredentials parameter is set to Sm_Api_Reason_PWSelfChange (indicating a user-initiated password change). |
pResourceContext
| I | A pointer to a resource definition structure. |
pRealm
| I | A realm definition structure. |
pUserCredentials
| I | A user credentials definition structure. |
pSession
| O | A user session definition structure. |
pNumAttributes
| O | The number of attributes in ppAttributes . |
ppAttributes
| O | A pointer to an array of response attribute definition structures. |
Return Values
- SM_AGENTAPI_YES. The user’s password was changed.
- SM_AGENTAPI_NO. The user’s password was not changed.
- SM_AGENTAPI_NOCONNECTION. The initialization was not done.
- SM_AGENTAPI_TIMEOUT. The function timed out.
- SM_AGENTAPI_FAILURE. The password was not changed