ictxStoreIdContext()--Store Identity Context


  Syntax
 #include <ictx.h>;

 int ictxStoreIdContext
 (
  ictxStorageMech_t    *  storageMechanism,
  ictxIdContext_t      *  identityContext,
  ictxOptions_t        *  options,
  ictxIdContextCredential_t  **  credential,
  ictxError_t          *  errorInfo
 )

  Threadsafe: Yes

  See eServer Implementation Notes for details on platform-specific details for this API.


The ictxStoreIdContext() function stores an identity context using the designated storage mechanism and returns a reference to that context.


Authorities and Locks

Refer to storage mechanism for authority information. See ictxStorageMech--Identity Context Storage Mechanism Parameter.


Parameters

storageMechanism  (Input)
The storage mechanism to use when storing the identity context information. For the format of the structure, see ictxStorageMech--Identity Context Storage Mechanism Parameter.

identityContext  (Input)
The identity context information to be stored. For the format of the structure, see ictxIdContext--Identity Context Info Parameter.

options  (Input)
The options that can be specified for the identity context reference. This parameter may be NULL. If this parameter is NULL, the default values will be used for the options. For the format of the structure, see ictxOptions--Identity Context Options Parameter.

credential  (Output)
Return pointer to the identity context credential. The credential is a structure that contains a username and password. When this credential is no longer needed, it must be freed using the Free Identity Context Credential (ictxFreeIdContextCredential) API.

errorInfo  (Output)
The structure in which to return error code information. If the return value is not 0, errorInfo is set with additional information. This parameter may be NULL. For the format of the structure, see ictxError--Identity Context Return Code Parameter.


Return Value

The return value from the API.

0
Request was successful.

ICTXERR_PARM_REQ (1)
Missing required parameter. Please check API documentation.

ICTXERR_NOMEM (2)
No memory available. Unable to allocate required space.

ICTXERR_EIM (3)
Error occurred using EIM interfaces.

ICTXERR_IDCONTEXT_INVALID (4)
Identity context parameter is not valid. The OID and identity context are required. The identity context length must be greater than 0.

ICTXERR_STORAGEMECH_NOT_SUPPORTED (5)
The storage mechanism is not a supported storage mechanism.

ICTXERR_OPTIONS_NOT_SUPPORTED (6)
Options are not supported.

ICTXERR_TIMEOUT_INVALID (7)
Timeout value in options is not valid.

ICTXERR_STORAGEMECH_INVALID (28)
Storage mechanism parameter is not valid. A required parameter may be missing.


eServer Implementation Notes

  1. AIX implementation details:
  2. Linux implementation details:
  3. i5/OS implementation details:
  4. Windows implementation details:
  5. z/OS implementation details:

Related Information




Example

The following example stores an identity context. The caller supplies the correct storage mechanism information. Note: Read the Code example disclaimer for important legal information.

#include <ictx.h>
#include <string.h>
	
int storeIdContext( ictxStorageMech_t * storageMech,
		    ictxIdContext_t  * authContext,
                    char            ** credential)
{
    int rc;

    ictxOptions_t options;

    ictxError_t errorInfo;
    
    /*----------------------------------------------------------------*/
    /*  Set up options                                                */
    /*----------------------------------------------------------------*/
    options.format = ICTX_OPTIONS_FORMAT_0;
    options.options.format0.timeout = 45;

    /*----------------------------------------------------------------*/
    /*  Store authentication context                                  */
    /*----------------------------------------------------------------*/
    if (0 != (rc = ictxStoreIdContext(storageMech,
                                      authContext,
                                      &options,
                                      credential,
                                      &errorInfo)))
    {
	.
	.
	.
        return -1;
    }

    return 0;
}


Top | Security APIs | APIs by category