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
Produces an encrypted token of session and other information that can be shared between standard SiteMinder Web Agents and custom agents. The mutual access to this information allows a custom agent to participate in a single sign-on environment with a standard SiteMinder Web Agent.
Syntax
int SM_EXTERN Sm_AgentApi_CreateSSOToken ( const void* pHandle, Sm_AgentApi_Session_t* pSession, long nNumAttributes, Sm_AgentApi_Attribute_t* pTokenAttributes, long* pNumSSOTokenLength, char* lpszSSOToken );
Parameter |
I/O |
Description |
---|---|---|
pHandle |
I |
Agent API session handle returned in parameter ppHandle of Sm_AgentApi_Init(). |
pSession |
I |
Session information returned by the Sm_AgentApi_Login() call. |
nNum |
I |
The number of attributes to include in the token. The attributes are specified in the parameter pTokenAttributes. |
pToken |
I |
The user attributes to include in the token. Valid values:
Any other attribute is ignored. The fields in the Sm_AgentApi_Attribute_t structure that apply to this function are:
|
pNumSSOToken |
I, O |
The length of the lpszSSOToken buffer passed in to receive the token. The maximum size is specified by SSO_TOKEN_MAX_SIZE, defined in SmAgentAPI.h. Allow space for the null-terminator character. On output, this parameter is set to the actual length of the returned token, including the null-terminator character. |
lpszSSOToken |
O |
The token returned from this function. Write this token to the SMSESSION cookie. |
Return Values
Remarks
This function associates the user attribute information specified in the pTokenAttributes parameter with session and other attribute information returned from the call to Sm_AgentApi_Login(). The information in the resulting token can be shared between standard SiteMinder Web Agents and custom agents, allowing single sign-on operations between the standard and custom agents.
This call does not allocate any memory.
To decode token information, call Sm_AgentApi_DecodeSSOToken().
Decodes a single sign-on token and returns a subset of its attributes. Optionally, you can update the token’s last-access timestamp, and then update the SMSESSION cookie with the new token.
Syntax
int SM_EXTERN Sm_AgentApi_DecodeSSOToken ( const void* pHandle, const char* lpszSSOToken, long* nTokenVersion, long* pThirdPartyToken, long* pNumAttributes, Sm_AgentApi_Attribute_t** ppTokenAttributes, long nUpdateToken, long* pNumUpdatedSSOTokenLength, char* lpszUpdatedSSOToken );
Parameter |
I/O |
Description |
---|---|---|
pHandle |
I |
Agent API session handle returned in parameter ppHandle of Sm_AgentApi_Init(). |
lpszSSOToken |
I |
Null-terminated character array that contains the token to be decoded. The custom agent finds the token in either of these locations:
|
nTokenVersion |
O |
The SiteMinder version of the token. |
pThirdParty |
O |
A non-zero value indicates that the token was originally produced by a custom (third-party) agent and has not yet been updated by a standard SiteMinder agent. |
pNumAttributes |
O |
The number of attributes retrieved from the token. The attributes are specified in the parameter ppTokenAttributes. |
ppToken |
O |
The attributes extracted from the token. Valid values:
|
nUpdateToken |
I |
A non-zero value indicates that an updated token is requested. The updated token is written to lpszUpdatedSSOToken. Set the nUpdateToken flag to a non-zero value if you want to update the attribute SM_AGENTAPI_ATTR_LASTSESSIONTIME. |
pNumUpdatedSSO |
I, O |
The length of the lpszUpdatedSSOToken buffer to receive the token. The maximum size is specified by SSO_TOKEN_MAX_SIZE, defined in SmAgentAPI.h. Allow space for the null-terminator character. On output, this parameter is set to the actual length of the returned token, including the null-terminator character. |
lpszUpdated |
O |
The updated token returned from this function. Write this token to the SMSESSION cookie. A token is returned only if nUpdateToken is set to a non-zero value. |
Returns
Remarks
This function accepts a single sign-on token as input and returns a subset of the token’s attributes.
You can update the token’s last-access timestamp. To do so, assign a non-zero value to the parameter nUpdateToken. The token that includes the updated timestamp is returned in lpszUpdatedSSOToken. Write the updated token to the SMSESSION cookie.
This function allocates memory for the attribute list. To deallocate this memory, call Sm_AgentApi_FreeAttributes().
To create a single sign-on token, call Sm_AgentApi_CreateSSOToken().
Copyright © 2015 CA Technologies.
All rights reserved.
|
|