MarkLogic Connect
MarkLogic Connect Client API Collection
|
#include <Credentials.hpp>
Public Member Functions | |
Credentials () | |
Credentials (const std::string &username, const std::string &password) | |
Credentials (const std::string &username, const std::string &password, const std::string &cnonce, const uint32_t &nc) | |
Credentials (const std::wstring &username, const std::wstring &password) | |
bool | canAuthenticate (void) const |
void | parseWWWAuthenticateHeader (const std::string &_raw) |
std::string | getNonce (void) const |
std::string | getQop (void) const |
std::string | getOpaque (void) const |
std::string | getRealm (void) const |
Protected Member Functions | |
std::string | authenticate (const std::string &method, const std::string &uri, const std::string &auth_header) |
std::string | authenticate (const std::string &method, const std::string &uri) |
std::string | generateRandomCnonce (void) const |
Friends | |
class | AuthenticatingProxy |
Used to manage the credentials for digest authentication. Normally the username and password are initially known. As part of the Digest challenge, the server will return a qop value, nonce, and relam. The client is responsible for generating a client side nonce and for managing the nonce count.
mlclient::internals::Credentials::Credentials | ( | ) |
Constructor
mlclient::internals::Credentials::Credentials | ( | const std::string & | username, |
const std::string & | password | ||
) |
Constructor
username | The username |
password | The user's (plaintext) password |
mlclient::internals::Credentials::Credentials | ( | const std::string & | username, |
const std::string & | password, | ||
const std::string & | cnonce, | ||
const uint32_t & | nc | ||
) |
Constructor
username | The username |
password | The user's (plaintext) password |
cnonce | The client side nonce |
nc | The nonce count |
mlclient::internals::Credentials::Credentials | ( | const std::wstring & | username, |
const std::wstring & | password | ||
) |
Constructor
username | The username |
password | The user's (plaintext) password |
|
protected |
Generate the authentication header contents. This is what goes into the Authorize header. Parses the incoming authenticate header to produce the response header.
method | The HTTP method used. |
uri | The path portion of the URI |
auth_header | The contents of the WWW Authenticate header |
|
protected |
Generate the authentication header contents. This is what goes into the Authorize header. Requires that the credentials are set up to perform authentication and have a qop and nonce.
method | The HTTP method used. |
uri | The path portion of the URI |
bool mlclient::internals::Credentials::canAuthenticate | ( | void | ) | const |
Returns the if the credentials are capable of generating a response to the digest challenge.
|
protected |
Generate a random client nonce.
std::string mlclient::internals::Credentials::getNonce | ( | void | ) | const |
Returns the server provided nonce
std::string mlclient::internals::Credentials::getOpaque | ( | void | ) | const |
Returns the server provided opaque value
std::string mlclient::internals::Credentials::getQop | ( | void | ) | const |
Returns the server provided qop
std::string mlclient::internals::Credentials::getRealm | ( | void | ) | const |
Returns the server provided realm
void mlclient::internals::Credentials::parseWWWAuthenticateHeader | ( | const std::string & | _raw | ) |
Parses the Authenticate header to extract the nonce, the qop and the realm. Once the credentials have been provided the authenticate header, the credentials will be capable of formulating a response to the digest challenge.
_raw | The raw WWW Authenticate header |