The application calls this function to specify its credentials for purposes
of authentication. The server will use the security provider specified by
the scheme parameter to authenticate the client connection. If the
authentication request has failed:
- the server connection is dropped
- the watcher is called with the ZOO_AUTH_FAILED_STATE value as the state
parameter.
\param zh the zookeeper handle obtained by a call to \ref zookeeper_init
\param scheme the id of authentication scheme. Natively supported:
"digest" password-based authentication
\param cert application credentials. The actual value depends on the scheme.
\param certLen the length of the data parameter
\param completion the routine to invoke when the request completes. One of
the following result codes may be passed into the completion callback:
ZOK operation completed successfully
ZAUTHFAILED authentication failed
\param data the data that will be passed to the completion routine when the
function completes.
\return ZOK on success or one of the following errcodes on failure:
ZBADARGUMENTS - invalid input parameters
ZINVALIDSTATE - zhandle state is either ZOO_SESSION_EXPIRED_STATE or ZOO_AUTH_FAILED_STATE
ZMARSHALLINGERROR - failed to marshall a request; possibly, out of memory
ZSYSTEMERROR - a system error occured
\brief specify application credentials.
The application calls this function to specify its credentials for purposes of authentication. The server will use the security provider specified by the scheme parameter to authenticate the client connection. If the authentication request has failed: - the server connection is dropped - the watcher is called with the ZOO_AUTH_FAILED_STATE value as the state parameter. \param zh the zookeeper handle obtained by a call to \ref zookeeper_init \param scheme the id of authentication scheme. Natively supported: "digest" password-based authentication \param cert application credentials. The actual value depends on the scheme. \param certLen the length of the data parameter \param completion the routine to invoke when the request completes. One of the following result codes may be passed into the completion callback: ZOK operation completed successfully ZAUTHFAILED authentication failed \param data the data that will be passed to the completion routine when the function completes. \return ZOK on success or one of the following errcodes on failure: ZBADARGUMENTS - invalid input parameters ZINVALIDSTATE - zhandle state is either ZOO_SESSION_EXPIRED_STATE or ZOO_AUTH_FAILED_STATE ZMARSHALLINGERROR - failed to marshall a request; possibly, out of memory ZSYSTEMERROR - a system error occured