10Duke Enterprise C++ Client
|
#include <DefaultOAuthDeviceFlowAuthorizationRequest.h>
Default implementation of tenduke::oauth::device::OAuthDeviceFlowAuthorizationRequest
.
Public Member Functions | |
DefaultOAuthDeviceFlowAuthorizationRequest (std::string scope, const std::map< std::string, std::string > &additionalParameters, std::uint64_t timeoutS, const std::shared_ptr< const tenduke::oauth::OAuthConfiguration > &configuration, const std::shared_ptr< tenduke::time::Clock > &clock, const std::shared_ptr< const tenduke::http::HTTPClient > &httpClient, const std::shared_ptr< const tenduke::http::HTTPResponseToException > &throwException, const std::shared_ptr< const tenduke::json::JSONParser > &jsonParser) | |
Constructs new instance. | |
tenduke::oauth::device::DeviceAuthorizationResponse | authorizationRequest () override |
Performs Device Authorization Request. | |
std::unique_ptr< tenduke::oauth::OAuthState > | accessTokenRequest () override |
Performs Device Access Token Request. | |
void | cancel () override |
Marks the request canceled. | |
Protected Member Functions | |
virtual void | sleepFor (std::chrono::milliseconds slumbertime) |
Sleeps for given time. | |
tenduke::oauth::device::DefaultOAuthDeviceFlowAuthorizationRequest::DefaultOAuthDeviceFlowAuthorizationRequest | ( | std::string | scope, |
const std::map< std::string, std::string > & | additionalParameters, | ||
std::uint64_t | timeoutS, | ||
const std::shared_ptr< const tenduke::oauth::OAuthConfiguration > & | configuration, | ||
const std::shared_ptr< tenduke::time::Clock > & | clock, | ||
const std::shared_ptr< const tenduke::http::HTTPClient > & | httpClient, | ||
const std::shared_ptr< const tenduke::http::HTTPResponseToException > & | throwException, | ||
const std::shared_ptr< const tenduke::json::JSONParser > & | jsonParser | ||
) |
Constructs new instance.
scope | - |
additionalParameters | - |
timeoutS | timeout (in seconds) at the client end |
configuration | - |
clock | - |
httpClient | - |
throwException | - |
jsonParser | - |
|
overridevirtual |
Performs Device Access Token Request.
See: https://datatracker.ietf.org/doc/html/rfc8628#section-3.4
tenduke::Canceled | if the request was canceled by caller |
tenduke::TimedOut | if the request has timed out (either in client or by backend) |
tenduke::http::HTTPException | (or subclasses) in case of HTTPExceptions (e.g. HTTP 500) |
tenduke::json::JSONException | (or subclasses) in case response is not valid JSON (should not happen) |
tenduke::net::NetworkingException | (or subclasses) e.g. no network, invalid hostname, timeouts |
tenduke::oauth::OAuthServerError | if OAuth server returned an error |
tenduke::oauth::OAuthException | if some other OAuth error occurred |
Implements tenduke::oauth::device::OAuthDeviceFlowAuthorizationRequest.
|
overridevirtual |
Performs Device Authorization Request.
See: https://datatracker.ietf.org/doc/html/rfc8628#section-3.1
tenduke::TimedOut | if the request has timed out (either in client or by backend) |
tenduke::http::HTTPException | (or subclasses) in case of HTTPExceptions (e.g. HTTP 500) |
tenduke::net::NetworkingException | (or subclasses) e.g. no network, invalid hostname, timeouts |
tenduke::oauth::OAuthServerError | if OAuth server returned an error |
tenduke::oauth::OAuthException | if some other OAuth error occurred |
Implements tenduke::oauth::device::OAuthDeviceFlowAuthorizationRequest.
|
overridevirtual |
Marks the request canceled.
This will cause the polling to throw tenduke::TimedOut
.
Implements tenduke::oauth::device::OAuthDeviceFlowAuthorizationRequest.
|
protectedvirtual |
Sleeps for given time.
slumbertime | - |
Reimplemented in tenduke::test::oauth::device::FakeRequest.