HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
192 HP-UX C SIP Stack Programmer’s Guide
Client Authentication Implementation
&authEvHandlers,
sizeof(RvSipAuthenticatorEvHandlers));
return status;
}
/*=========================================================================================*/
AUTHENTICATION
OBJECT CONTROL
Each WWW-Authenticate/Proxy-Authenticate header that is received in a 401/
407 response message is saved in the relevant SIP Stack object (such as reg-
client and call-leg) for the entire lifetime of the object. The SIP Stack will insert
an equivalent Authorization header into every request that this SIP Stack object
sends. An authentication object holds the information of the received
Authentication header. The authentication object is represented by the
RvSipAuthObjHandle handle.
The application can go over the list of authentication objects within a SIP Stack
object (such as call-leg, register-client) and manipulate the authentication object
list with the following API functions:
RvSipXXXAuthObjGet()—gets all authentication objects from
the relevant SIP Stack object one after another (such as
RvSipRegClientAuthObjGet()).
RvSipXXXAuthObjRemove()—removes an authentication
object from the authentication-object list (such as
RvSipRegClientAuthObjRemove()).
RvSipXXXGetCurrProcessedAuthObj()—gets the currently
processed authentication object in the context of the
RvSipAuthenticatorGetSharedSecretEv() callback. The
application can then get and set additional information from/to
the received authentication object.
The application can query the authentication object parameters using the
following APIs:
RvSipAuthObjGetAuthenticationHeader()—gets the
Authentication header from the authentication-object.
RvSipAuthObjSetUserInfo()—sets the user information (user
name and password) in the authentication-object before
resending a request. In such cases, the
RvSipAuthenticatorGetSharedSecretEv() callback will not be
called for this object, since the SIP Stack already knows the
required information.
RvSipAuthObjSetAppContext()—sets an application context
pointer in the authentication-object, and gets it afterwards.