Previous Topic: Sm_PolicyApi_UserPasswordState_tNext Topic: Sm_PolicyApi_VariableType_t


Sm_PolicyApi_Variable_t

Defines a variable object that can be used in a variable expression for a policy or a response. Variable objects are managed by the Variable Functions.

A variable is a dynamic object that is resolved to a value during an authorization request. The variables appear within an active expression defined for a policy or a response.

Variables are used as follows:

Syntax

typedef struct Sm_PolicyApi_Variable_s
{
   int iStructId;
   char pszOid[BFSIZE];
   char pszName[BFSIZE];
   char pszDesc[BFSIZE];
   char pszVariableTypeOid[BFSIZE];
   char pszDefinition[BFSIZE];
   char pszMetaData[BFSIZE];
   int nReturnType;
   bool bPreFetchFlag;
   char pszDomainOid[BFSIZE];
   Sm_PolicyApi_Oid_t* pNestedVariableList;
   struct Sm_PolicyApi_Variable_s*   next;
} Sm_PolicyApi_Variable_t;

Field

Description

iStructId

Data structure ID, defined in Sm_PolicyApi_Structs_t.

pszOid

The unique object ID of the variable object.

pszName

The user-defined name of the variable object.

pszDesc

Optional text describing the variable object.

pszVariableTypeOid

The unique object ID of the variable type.

pszDefinition

Information needed to obtain the value of the variable at runtime.

pszMetaData

Reserved for use by the optional CA TransactionMinder product.

nReturnType

The data type of the variable value:

  • Sm_PolicyApi_VarReturnTypes_Boolean
  • Sm_PolicyApi_VarReturnTypes_Number
  • Sm_PolicyApi_VarReturnTypes_String
  • Sm_PolicyApi_VarReturnTypes_Date

bPreFetchFlag

Not currently used.

pszDomainOid

The unique object ID of the associated domain.

pNestedVariableList

A linked list of nested variable OIDs that are part of the definition of this variable.

next

Pointer to the next variable object structure.

Variable Definition

You define a variable by specifying where the variable's value can be found. You do so through the pszDefinition field.

The value of this field can be a simple string or a set of XML elements, depending on the variable type. Here are the SiteMinder variable types and a description of the pszDefinition field for each type:

Element

Description

RemoteURL

The URL to the Web Service that will resolve the WebService variable.

SSL

Specifies that the connection between the Policy Server and the Web Service should use SSL.

RemoteMethod

Set this element to POST.

ResultQuery

The return query, in XPath format. The Policy Server uses this information to search for the variable's value in the SOAP response document.

AuthCredentials

Optionally, specify the user's Web Service credentials through the following elements:

  • Username
  • Password (use either a SHA-1 password digest or a clear-text password)

Optionally, use the Hash element to specify that a hash of the password is to be included in the WS‑Security password.

Document

Optionally, use this element to define a SOAP header and/or SOAP body through the following elements:

  • Envelope. The SOAP namespace is:
    http://schemas.xmlsoap.org/soap/envelope
  • Header. A user-defined SOAP header. A WS‑Security header is automatically added to it if the user's Web Service credentials are specified.
  • Body. A user-defined SOAP body.

Nested variables of type RequestContext, UserContext, Post, and Static can be used inside the header and body. Their values are resolved and substituted before the request document is sent to the remote Web Service.

Specify a nested variable as follows:

$variable-name$

Note: The XML element structures shown above are formatted for legibility. The XML string supplied through the pszDefinition field should not be formatted with spaces, tabs, and return characters. For example, a RequestContext variable for a Resource attribute would be passed in pszDefinition as follows:

<RequestContextVariableDef><ItemName>Resource</ItemName></RequestContextVariableDef>