dxFeed Graal CXX API v4.0.0
|
The AuthToken class represents an authorization token and encapsulates information about the authorization scheme and its associated value. More...
#include <AuthToken.hpp>
Public Member Functions | |
std::string | getHttpAuthorization () const |
Returns the HTTP authorization header value. | |
std::string | getUser () const |
Returns the username or dxfcpp::String::NUL (std::string{"<null>"} ) if it is not known or applicable. | |
std::string | getPassword () const |
Returns the password or dxfcpp::String::NUL (std::string{"<null>"} ) if it is not known or applicable. | |
std::string | getScheme () const |
Returns the authentication scheme. | |
std::string | getValue () const |
Returns the access token for RFC6750 or the Base64-encoded "username:password" for RFC2617. | |
Static Public Member Functions | |
static AuthToken | valueOf (const StringLikeWrapper &string) |
Constructs an AuthToken from the specified string. | |
static AuthToken | createBasicToken (const StringLikeWrapper &userPassword) |
Constructs an AuthToken with the specified username and password per RFC2617. | |
static AuthToken | createBasicToken (const StringLikeWrapper &user, const StringLikeWrapper &password) |
Constructs an AuthToken with the specified username and password per RFC2617. | |
static AuthToken | createBasicTokenOrNull (const StringLikeWrapper &user, const StringLikeWrapper &password) |
Constructs an AuthToken with the specified username and password per RFC2617. | |
static AuthToken | createBearerToken (const StringLikeWrapper &token) |
Constructs an AuthToken with the specified bearer token per RFC6750. | |
static AuthToken | createBearerTokenOrNull (const StringLikeWrapper &token) |
Constructs an AuthToken with the specified bearer token per RFC6750. | |
static AuthToken | createCustomToken (const StringLikeWrapper &scheme, const StringLikeWrapper &value) |
Constructs an AuthToken with a custom scheme and value. | |
The AuthToken class represents an authorization token and encapsulates information about the authorization scheme and its associated value.
An AuthToken consists of the following components:
|
static |
|
static |
Constructs an AuthToken with the specified username and password per RFC2617.
Username and password can be empty.
userPassword | the string (or c-string or string view) containing the username and password in the format "username:password" |
JavaException("InvalidFormatException") | if the userPassword is malformed |
|
static |
|
static |
Constructs an AuthToken with the specified bearer token per RFC6750.
token | the access token |
JavaException("InvalidFormatException") | if the token is empty |
|
static |
|
static |
Constructs an AuthToken with a custom scheme and value.
scheme | the custom scheme |
value | the custom value |
JavaException("InvalidFormatException") | if the scheme or value is empty |
std::string AuthToken::getHttpAuthorization | ( | ) | const |
Returns the HTTP authorization header value.
std::string AuthToken::getPassword | ( | ) | const |
Returns the password or dxfcpp::String::NUL (std::string{"<null>"}
) if it is not known or applicable.
std::string{"<null>"}
) if not known or applicable std::string AuthToken::getScheme | ( | ) | const |
Returns the authentication scheme.
std::string AuthToken::getUser | ( | ) | const |
Returns the username or dxfcpp::String::NUL (std::string{"<null>"}
) if it is not known or applicable.
std::string{"<null>"}
) if not known or applicable std::string AuthToken::getValue | ( | ) | const |
Returns the access token for RFC6750 or the Base64-encoded "username:password" for RFC2617.
|
static |
Constructs an AuthToken from the specified string.
string | The string (or c-string or string view) with space-separated scheme and value. |
JavaException("InvalidFormatException") | if the string is malformed, or if the scheme is "Basic" but the format does not comply with RFC2617 |