|
10Duke Enterprise C++ Client
|
#include <BaseOAuthClient.h>
Base class for OAuth-clients.
A rather torso, since browser-based and device-flow clients have wildly different signatures.
Public Member Functions | |
| BaseOAuthClient (std::shared_ptr< const tenduke::oauth::OAuthConfiguration > config, std::shared_ptr< const tenduke::http::HTTPClient > httpClient, std::shared_ptr< const tenduke::json::JSONParser > jsonParser, std::shared_ptr< tenduke::time::Clock > clock) | |
| Constructs new instance. | |
| std::shared_ptr< const OAuthConfiguration > | getConfiguration () const |
| Returns the configuration of this client. | |
| std::unique_ptr< const tenduke::oauth::OAuthRefreshRequest > | refresh (std::shared_ptr< tenduke::oauth::OAuthState > state) const override |
| Creates OAuthRefreshRequest for refreshing the state. | |
Protected Attributes | |
| const std::shared_ptr< const OAuthConfiguration > | config |
| OAuth configuration. | |
| const std::shared_ptr< const tenduke::http::HTTPClient > | httpClient |
| HTTP client. | |
| const std::shared_ptr< const tenduke::json::JSONParser > | jsonParser |
| For parsing responses. | |
| const std::shared_ptr< tenduke::time::Clock > | clock |
| Clock to generate "expires-at" from "expires-in". | |
| tenduke::oauth::BaseOAuthClient::BaseOAuthClient | ( | std::shared_ptr< const tenduke::oauth::OAuthConfiguration > | config, |
| std::shared_ptr< const tenduke::http::HTTPClient > | httpClient, | ||
| std::shared_ptr< const tenduke::json::JSONParser > | jsonParser, | ||
| std::shared_ptr< tenduke::time::Clock > | clock ) |
Constructs new instance.
| config | - |
| httpClient | - |
| jsonParser | - |
| clock | - |
|
inline |
Returns the configuration of this client.
|
overridevirtual |
Creates OAuthRefreshRequest for refreshing the state.
After executing the request, assign the returned state back to the original state to get refresh results.
| state | the state to refresh |
| tenduke::oauth::OAuthException | if the state is not refreshable. |
Implements tenduke::oauth::OAuthClient.