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:
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
*lpnStatusCode = Sm_AuthApi_Cred_None|Sm_AuthApi_Cred_AllowAnonymous;
*lpnStatusCode = Sm_AuthApi_Cred_Basic;
*lpnStatusCode = Sm_AuthApi_Cred_Basic | Sm_AuthApi_Cred_SSLRequired; strcpy(lpszStatusBuffer, "https://xxx.yyy.zzz/secure.ssc?basic")
*lpnStatusCode = Sm_AuthApi_Cred_Basic | Sm_AuthApi_Cred_FormRequired; strcpy(lpszStatusBuffer, "https://xxx.yyy.zzz/getcredentials.fcc")
*lpnStatusCode = Sm_AuthApi_Cred_SSLRequired | Sm_AuthApi_Cred_X509Cert; strcpy(lpszStatusBuffer, "https://xxx.yyy.zzz/getcert.scc?cert")
*lpnStatusCode = Sm_AuthApi_Cred_Basic | Sm_AuthApi_Cred_SSLRequired | Sm_AuthApi_Cred_X509Cert; strcpy(lpszStatusBuffer, "https://xxx.yyy.zzz/getcert.scc?cert+basic")
Copyright © 2010 CA. All rights reserved. | Email CA about this topic |