QOAuth
1.0.1
|
This namespace encapsulates all classes and definitions provided by libqoauth.
Classes | |
class | Interface |
This class provides means for interaction with network services supporting OAuth authorization scheme. More... | |
Typedefs | |
typedef QMultiMap< QByteArray, QByteArray > | ParamMap |
A typedef for the data structure for storing request parameters. | |
Enumerations | |
enum | SignatureMethod { HMAC_SHA1, RSA_SHA1, PLAINTEXT } |
This enum type describes the signature method used by the request. More... | |
enum | HttpMethod { GET, POST, HEAD, PUT, DELETE } |
This enum type specifies the HTTP method used for creating a Signature Base String and/or sending a request. More... | |
enum | ParsingMode { ParseForRequestContent, ParseForInlineQuery, ParseForHeaderArguments, ParseForSignatureBaseString } |
This enum type specifies the method of parsing parameters into a parameter string. More... | |
enum | ErrorCode { NoError = 200, BadRequest = 400, Unauthorized = 401, Forbidden = 403, Timeout = 1001, ConsumerKeyEmpty, ConsumerSecretEmpty, UnsupportedHttpMethod, RSAPrivateKeyEmpty = 1101, RSADecodingError, RSAKeyFileError, OtherError } |
This enum type defines error types that are assigned to the QOAuth::Interface::error property. More... | |
Functions | |
QOAUTH_EXPORT QByteArray | supportedOAuthVersion () |
Returns the supported OAuth protocol version. | |
QOAUTH_EXPORT QByteArray | tokenParameterName () |
Returns the name of the Access Token argument parameter (oauth_token in current implementation) More... | |
QOAUTH_EXPORT QByteArray | tokenSecretParameterName () |
Returns the name of the Token Secret argument parameter (oauth_token_secret in current implementation) More... | |
enum QOAuth::ErrorCode |
This error codes collection contains both network-related errors and those that can occur when incorrect arguments are provided to any of the class's methods.
Enumerator | |
---|---|
NoError |
No error occured (so far :-) ) |
BadRequest |
Represents HTTP status code |
Unauthorized |
Represents HTTP status code |
Forbidden |
Represents HTTP status code |
Timeout |
Represents a request timeout error. |
ConsumerKeyEmpty |
Consumer key has not been provided. |
ConsumerSecretEmpty |
Consumer secret has not been provided. |
UnsupportedHttpMethod |
The HTTP method is not supported by the request.
|
RSAPrivateKeyEmpty |
RSA private key has not been provided. |
RSADecodingError |
There was a problem decoding the RSA private key (the key is invalid or the provided passphrase is incorrect) |
RSAKeyFileError |
The provided key file either doesn't exist or is unreadable. |
OtherError |
A network-related error not specified above. |
enum QOAuth::HttpMethod |
The HTTP method has to be specified in QOAuth class for two reasons:
Enumerator | |
---|---|
GET |
Sets the HTTP method to GET. |
POST |
Sets the HTTP method to POST. |
HEAD |
Sets the HTTP method to HEAD. |
PUT |
Sets the HTTP method to PUT. |
DELETE |
Sets the HTTP method to DELETE. |
enum QOAuth::ParsingMode |
When creating a parameters string for a custom request using QOAuth::Interface::createParametersString() the parsing mode must be defined in order to prepare the string correctly.
According to what is stated in OAuth 1.0 Core specification, parameters can be passed in a request to the Service Provider in 3 different ways. When using QOAuth::Interface::createParametersString(), choose the one that suits you by setting ParsingMode appropriatelly.
Enumerator | |
---|---|
ParseForRequestContent |
Inline query format ( |
ParseForInlineQuery |
Same as ParseForRequestContent, but prepends the string with a question mark - suitable for GET requests (appending parameters to the request URL) |
ParseForHeaderArguments |
HTTP request header format (parameters to be put inside a request header) |
ParseForSignatureBaseString |
Signature Base String format, meant for internal use. |
There are 3 different signature methods defined by the OAuth protocol. This enum is used to specify the method used by a specific request. Hence, one of its values must be passed as a parameter in any of the QOAuth::Interface::requestToken(), QOAuth::Interface::accessToken() or QOAuth::Interface::createParametersString() method.
Enumerator | |
---|---|
HMAC_SHA1 |
Sets the signature method to HMAC-SHA1. |
RSA_SHA1 |
Sets the signature method to RSA-SHA1 (not implemented yet) |
PLAINTEXT |
Sets the signature method to PLAINTEXT (not implemented yet) |
QByteArray QOAuth::tokenParameterName | ( | ) |
Useful when reading Service Provider's reply for QOAuth::Interface::accessToken() request, e.g:
QByteArray QOAuth::tokenSecretParameterName | ( | ) |