ASPEN_ValidateSession

 

Related Topics

 

 

Purpose

Validate the client's user identity with the Server to allow access to financial market and information.

 

 

Call Syntax

#include <aspen.h>

AspenRequest(GLOBAL_session, ASPEN_ValidateSession, &stopInfo, NULL);

 

 

Parameters

Input

The input parameter for this services is a pointer to a ASPEN_VALIDATE_INPUT structure that contains the user's name, password and new password if necessary.

 

Output

None.

 

 

Structures

typedef struct

{

   char  username[ASPEN_USER_NAME_SIZE+1];

   char  password[ASPEN_PASSWORD_SIZE+1];

   char  newpassword[ASPEN_PASSWORD_SIZE+1];

}ASPEN_VALIDATE_INPUT;

 

 

Remarks

ASPEN_ValidateSession is used to establish a user identity; this identity has an associated entitlement profile that determines financial instruments the session can access. If the Server can authenticate the user-name and password provided, validation occurs.

 

The ASPEN_ValidateSession service can only be requested on open but not validated sessions.

 

 

Return Value

ASPEN_OK

Validation granted.

ASPEN_SV_UNAUTHORIZED

Indicates that the user name is not recognized in the Server's internal list of defined users. Validation is denied.

ASPEN_SV_INVALID_PASSWORD

Indicates that the password for a user name is not recognized in the Server's internal list of defined users. Validation is denied.

ASPEN_SV_SERVER_AT_CAPACITY

Indicates that all entitlements associated with the Server are currently in use.

 

 

See Also

ASPEN_CloseSession

ASPEN_OpenSession

ASPEN_ValidateSession

AspenRequest()

Security Authentication

ASPEN_VALIDATE_INPUT

 

 

Example

int CAspenRequestDlg::DoASPEN_ValidateSession()

{

   ASPEN_ADDRESS           serverAddress;

   ASPEN_VALIDATE_INPUT    validateRequest;

   ASPEN_VALIDATE_OUTPUT   validateReply;

   char                    IPaddress[20];

   server_list             *slp = list;

   int                     retval;

// Connect to Server

   strcpy(IPaddress, svServerAddr);

   /* Build Address */

   retval = AspenBuildServerAddress(ASPEN_INET, IPaddress, &serverAddress);

   if (retval != ASPEN_OK)

   {

      return retval;

   }

   /* Open Session */

   retval = AspenRequest(0, ASPEN_OpenSession, (void *)&serverAddress, &slp->server_session);

   if (retval == ASPEN_OK)

   {

   /* Validate Session */

      strcpy(validateRequest.username, svUserName);

      strcpy(validateRequest.password, svPassword);

      strcpy(validateRequest.newpassword, "");

      retval = AspenRequest(slp->server_session, ASPEN_ValidateSession, &validateRequest, &validateReply);

   }

   return retval;

}

 

©2006 Aspen Research Group, Ltd. All rights reserved. Terms of Use.