10Duke Scale C++ Client
Loading...
Searching...
No Matches
tenduke::oauth::BaseOAuthClient Class Reference

#include <BaseOAuthClient.h>

Detailed Description

Base class for OAuth-clients.

A rather torso, since browser-based and device-flow clients have wildly different signatures.

Inheritance diagram for tenduke::oauth::BaseOAuthClient:
tenduke::oauth::OAuthClient tenduke::oauth::device::DefaultOAuthDeviceFlow tenduke::oauth::pkce::OAuthPKCEFlow

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 OAuthConfigurationgetConfiguration () const
 Returns the configuration of this client.
 
std::unique_ptr< const tenduke::oauth::OAuthRefreshRequestrefresh (std::shared_ptr< tenduke::oauth::OAuthState > state) const override
 Creates OAuthRefreshRequest for refreshing the state.
 

Protected Attributes

const std::shared_ptr< const OAuthConfigurationconfig
 OAuth configuration.
 
const std::shared_ptr< const tenduke::http::HTTPClienthttpClient
 HTTP client.
 
const std::shared_ptr< const tenduke::json::JSONParserjsonParser
 For parsing responses.
 
const std::shared_ptr< tenduke::time::Clockclock
 Clock to generate "expires-at" from "expires-in".
 

Constructor & Destructor Documentation

◆ BaseOAuthClient()

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.

Parameters
config-
httpClient-
jsonParser-
clock-

Member Function Documentation

◆ getConfiguration()

std::shared_ptr< const OAuthConfiguration > tenduke::oauth::BaseOAuthClient::getConfiguration ( ) const
inline

Returns the configuration of this client.

Returns
-

◆ refresh()

std::unique_ptr< const ::OAuthRefreshRequest > tenduke::oauth::BaseOAuthClient::refresh ( std::shared_ptr< tenduke::oauth::OAuthState state) const
overridevirtual

Creates OAuthRefreshRequest for refreshing the state.

After executing the request, assign the returned state back to the original state to get refresh results.

Parameters
statethe state to refresh
Returns
the refresh request
Exceptions
tenduke::oauth::OAuthExceptionif the state is not refreshable.

Implements tenduke::oauth::OAuthClient.


The documentation for this class was generated from the following files: