HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
196 HP-UX C SIP Stack Programmer’s Guide
Client Authentication Implementation
RVSIP_AUTH_ALGORITHM_MD5,NULL);
/*Sets the QOP options.*/
RvSipAuthenticationHeaderSetQopOption(hProxyAuth,
RVSIP_AUTH_QOP_AUTH_ONLY);
/*------------------------------------
Sets the Proxy-Authenticate header.
--------------------------------------*/
status =
RvSipAuthenticatorSetProxyAuthInfo(hAuthenticator,
hProxyAuth,
"bob",
"bsg23hp");
return status;
}
/*==========================================================================*/
CLIENT
A
UTHENTICATION FOR
STAND-ALONE
TRANSACTION
A stand-alone client transaction can receive a 401 or 407 response. The
response will include a challenge, and the application may wish to send a new
request with the required credentials. To do this, the application needs to create a
new transaction. The application should then use the
RvSipAuthenticatorPrepareAuthorizationHeader() function to add the
credentials to the new outgoing request.
The application should supply this function with the outbound message together
with the Authentication header taken from the 401 or 407 response. The
function will add the required Authorization header to the message.
Note It is the responsibility of the application to add to the new request all the
applicative information that was added to the original request.
CLIENT
A
UTHENTICATION WITH
M
ULTIPLE PROXIES
In many cases, a request message sent by a client has to traverse several proxies
that require authentication. Each of these proxies will require different
credentials in order to forward the message to the next hop. Each of the
SIP Stack objects (register-clients and call-legs) maintains a list of all the
challenges returned from the different proxies in the message path. When calling
the RvSipXXXAuthenticat() API function, suitable credentials will be added for
each of these challenges.