Previous Topic: SmAuthInit()

Next Topic: SmAuthRelease()

SmAuthQuery()

Returns information about an authentication scheme.

Syntax

Sm_AuthApi_Status_t SM_EXTERN SmAuthQuery (
   const char*                   lpszParam,
   const char*                   lpszSharedSecret,
   const Sm_AuthApi_QueryCode_t  code,
   char*                         lpszStatusBuffer,
   int*                          lpnStatusCode
);

Parameter

I/O

Description

lpszParam

I

Pointer to the buffer containing the null-terminated parameter string as specified for the authentication scheme.

lpszSharedSecret

I

Pointer to the buffer containing the null-terminated shared secret string as specified for the authentication scheme.

code

I

Request code as defined by an enum type Sm_AuthApi_QueryCode_t, which contains the following values:

  • Sm_AuthApi_QueryDescription. Requests the scheme's description. The scheme returns a description through lpszStatusBuffer and the Authentication API version number through lpnStatusCode.
  • Sm_AuthApi_QueryCredentialsReq.
    Requests the credentials required by the scheme and where to obtain them. The scheme should return a bit mask through lpnStatusCode, which represents the credentials needed for authentication.

Individual flags are defined by the enum type Sm_Api_Credentials_t. The scheme may return the location where the credentials can be obtained (that is, an HTTP URL) via the lpszStatusBuffer parameter.

lpszStatusBuffer

O

Receives a character string response. Up to Sm_AuthApi_StatusBufSize characters can be returned.

lpnStatusCode

O

If the call requests the scheme's description, receives a numeric response indicating the version number of the Authentication API. Supported versions are Sm_Api_Version_V4 and Sm_Api_Version_V4_1.

If the call requests the credentials required by the scheme, the scheme returns one or more credentials. See Remarks. These constants are defined in SmApi.h.

Returns

This function returns one of the following values defined in the enumerated type Sm_AuthApi_Status_t:

Remarks

The scheme must support request codes as specified by enumeration type Sm_AuthApi_QueryCode_t. The caller queries the scheme to find out what kind of credentials are required for authentication and where to obtain them.

The credentials are defined by the enum type Sm_Api_Credentials_t and can be combined to request multiple credentials. The caller collects the requested credentials, places them into the Sm_AuthApi_UserCredentials_t context structure, and calls the SmAuthenticate() function.

The individual flags in Sm_Api_Credentials_t are as follows:

Examples


Copyright © 2010 CA. All rights reserved. Email CA about this topic