10Duke Enterprise C++ Client
|
#include <DefaultOAuthRefreshRequest.h>
Default implementation tenduke::oauth::OAuthRefreshRequest
.
Public Member Functions | |
DefaultOAuthRefreshRequest (const std::shared_ptr< const tenduke::oauth::OAuthState > &state, const std::shared_ptr< const tenduke::oauth::OAuthConfiguration > &config, const std::shared_ptr< const tenduke::http::HTTPClient > &httpClient, const std::shared_ptr< const tenduke::json::JSONParser > &jsonParser, const std::shared_ptr< tenduke::time::Clock > &clock) | |
Constructs new instance. | |
std::unique_ptr< tenduke::oauth::OAuthState > | execute () const override |
Executes the refresh request. | |
Protected Member Functions | |
virtual std::unique_ptr< tenduke::oauth::OAuthTokenRequest > | createTokenRequest () const |
Creates the token request. | |
virtual std::map< std::string, std::string > | buildRequestParameters () const |
Builds request parameters. | |
tenduke::oauth::DefaultOAuthRefreshRequest::DefaultOAuthRefreshRequest | ( | const std::shared_ptr< const tenduke::oauth::OAuthState > & | state, |
const std::shared_ptr< const tenduke::oauth::OAuthConfiguration > & | config, | ||
const std::shared_ptr< const tenduke::http::HTTPClient > & | httpClient, | ||
const std::shared_ptr< const tenduke::json::JSONParser > & | jsonParser, | ||
const std::shared_ptr< tenduke::time::Clock > & | clock | ||
) |
Constructs new instance.
state | state to refresh |
config | OAuth configuration |
httpClient | - |
jsonParser | to parse the response |
clock | to generate "expires-at" from "expires-in" |
|
protectedvirtual |
Builds request parameters.
|
protectedvirtual |
Creates the token request.
|
overridevirtual |
Executes the refresh request.
The call is synchronous.
std::nested_exception | when the there is some nested cause |
tenduke::http::HTTPException | (or subclasses of it) when the server responds with HTTP error status code which does not indicate OAuth-error, e.g. 500 (internal server error) or 404 (not found = wrong endpoint configured) |
tenduke::json::JSONParsingException | when server response is not valid JSON |
tenduke::oauth::OAuthException | when the server response is not what we expected, e.g.
|
tenduke::oauth::OAuthServerError | when the server responds with an error |
tenduke::net::NetworkingException | (or subclasses of it) when networking error occurred, e.g.
|
Implements tenduke::oauth::OAuthRefreshRequest.