Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
Poco::Net::HTTPBasicCredentials Class Reference

#include <HTTPBasicCredentials.h>

Public Member Functions

 HTTPBasicCredentials ()
 
 HTTPBasicCredentials (const std::string &username, const std::string &password)
 Creates an empty HTTPBasicCredentials object.
 
 HTTPBasicCredentials (const HTTPRequest &request)
 Creates a HTTPBasicCredentials object with the given username and password.
 
 HTTPBasicCredentials (const std::string &authInfo)
 
 ~HTTPBasicCredentials ()
 
void clear ()
 Destroys the HTTPBasicCredentials.
 
void setUsername (const std::string &username)
 Clears both username and password.
 
const std::string & getUsername () const
 Sets the username.
 
void setPassword (const std::string &password)
 Returns the username.
 
const std::string & getPassword () const
 Sets the password.
 
bool empty () const
 Returns the password.
 
void authenticate (HTTPRequest &request) const
 Returns true if both username and password are empty, otherwise false.
 
void proxyAuthenticate (HTTPRequest &request) const
 Adds authentication information to the given HTTPRequest.
 

Static Public Attributes

static const std::string SCHEME
 Adds proxy authentication information to the given HTTPRequest.
 

Protected Member Functions

void parseAuthInfo (const std::string &authInfo)
 

Private Member Functions

 HTTPBasicCredentials (const HTTPBasicCredentials &)
 
HTTPBasicCredentialsoperator= (const HTTPBasicCredentials &)
 

Private Attributes

std::string _username
 
std::string _password
 

Detailed Description

This is a utility class for working with HTTP Basic Authentication in HTTPRequest objects.

Definition at line 31 of file HTTPBasicCredentials.h.

Constructor & Destructor Documentation

◆ HTTPBasicCredentials() [1/5]

Poco::Net::HTTPBasicCredentials::HTTPBasicCredentials ( )

◆ HTTPBasicCredentials() [2/5]

Poco::Net::HTTPBasicCredentials::HTTPBasicCredentials ( const std::string & username,
const std::string & password )

Creates an empty HTTPBasicCredentials object.

◆ HTTPBasicCredentials() [3/5]

Poco::Net::HTTPBasicCredentials::HTTPBasicCredentials ( const HTTPRequest & request)
explicit

Creates a HTTPBasicCredentials object with the given username and password.

◆ HTTPBasicCredentials() [4/5]

Poco::Net::HTTPBasicCredentials::HTTPBasicCredentials ( const std::string & authInfo)
explicit

Creates a HTTPBasicCredentials object with the authentication information from the given request.

Throws a NotAuthenticatedException if the request does not contain basic authentication information.

◆ ~HTTPBasicCredentials()

Poco::Net::HTTPBasicCredentials::~HTTPBasicCredentials ( )

Creates a HTTPBasicCredentials object with the authentication information in the given string. The authentication information can be extracted from a HTTPRequest object by calling HTTPRequest::getCredentials().

◆ HTTPBasicCredentials() [5/5]

Poco::Net::HTTPBasicCredentials::HTTPBasicCredentials ( const HTTPBasicCredentials & )
private

Extracts username and password from Basic authentication info by base64-decoding authInfo and splitting the resulting string at the ':' delimiter.

Member Function Documentation

◆ authenticate()

void Poco::Net::HTTPBasicCredentials::authenticate ( HTTPRequest & request) const

Returns true if both username and password are empty, otherwise false.

◆ clear()

void Poco::Net::HTTPBasicCredentials::clear ( )

Destroys the HTTPBasicCredentials.

◆ empty()

bool Poco::Net::HTTPBasicCredentials::empty ( ) const
inline

Returns the password.

Definition at line 114 of file HTTPBasicCredentials.h.

◆ getPassword()

const std::string & Poco::Net::HTTPBasicCredentials::getPassword ( ) const
inline

Sets the password.

Definition at line 108 of file HTTPBasicCredentials.h.

◆ getUsername()

const std::string & Poco::Net::HTTPBasicCredentials::getUsername ( ) const
inline

Sets the username.

Definition at line 102 of file HTTPBasicCredentials.h.

◆ operator=()

HTTPBasicCredentials & Poco::Net::HTTPBasicCredentials::operator= ( const HTTPBasicCredentials & )
private

◆ parseAuthInfo()

void Poco::Net::HTTPBasicCredentials::parseAuthInfo ( const std::string & authInfo)
protected

◆ proxyAuthenticate()

void Poco::Net::HTTPBasicCredentials::proxyAuthenticate ( HTTPRequest & request) const

Adds authentication information to the given HTTPRequest.

◆ setPassword()

void Poco::Net::HTTPBasicCredentials::setPassword ( const std::string & password)

Returns the username.

◆ setUsername()

void Poco::Net::HTTPBasicCredentials::setUsername ( const std::string & username)

Clears both username and password.

Member Data Documentation

◆ _password

std::string Poco::Net::HTTPBasicCredentials::_password
private

Definition at line 95 of file HTTPBasicCredentials.h.

◆ _username

std::string Poco::Net::HTTPBasicCredentials::_username
private

Definition at line 94 of file HTTPBasicCredentials.h.

◆ SCHEME

const std::string Poco::Net::HTTPBasicCredentials::SCHEME
static

Adds proxy authentication information to the given HTTPRequest.

Definition at line 82 of file HTTPBasicCredentials.h.


The documentation for this class was generated from the following file: