10Duke Enterprise C++ Client
Loading...
Searching...
No Matches
tenduke::oauth::ropg::OAuthResourceOwnerPasswordFlow Class Reference

#include <OAuthResourceOwnerPasswordFlow.h>

Detailed Description

OAuth Resource Owner Password Credentials Grant implementation of tenduke::oauth::OAuthClient.

Reference: https://datatracker.ietf.org/doc/html/rfc6749#section-4.3

The flow uses a callback, tenduke::oauth::ropg::ResourceOwnerPasswordCredentialsProvider, to provide the credentials.

See also tenduke::oauth::ropg::OAuthResourceOwnerPasswordRequest.

Inheritance diagram for tenduke::oauth::ropg::OAuthResourceOwnerPasswordFlow:
tenduke::oauth::BaseOAuthClient tenduke::oauth::OAuthClient

Public Member Functions

 OAuthResourceOwnerPasswordFlow (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, const ::tenduke::oauth::ropg::ResourceOwnerPasswordCredentialsProvider &usernamePasswordProvider)
 Constructs new instance.
 
virtual std::unique_ptr< const ::tenduke::oauth::ropg::OAuthResourceOwnerPasswordRequestauthorize (const std::string &scopes) const
 Creates the OAuth authorization request.
 
- Public Member Functions inherited from 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.
 
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.
 

Additional Inherited Members

- Protected Attributes inherited from tenduke::oauth::BaseOAuthClient
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

◆ OAuthResourceOwnerPasswordFlow()

tenduke::oauth::ropg::OAuthResourceOwnerPasswordFlow::OAuthResourceOwnerPasswordFlow ( 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,
const ::tenduke::oauth::ropg::ResourceOwnerPasswordCredentialsProvider usernamePasswordProvider 
)

Constructs new instance.

Parameters
config-
httpClient-
jsonParser-
clock-
usernamePasswordProviderthe callback to provide login credentials

Member Function Documentation

◆ authorize()

std::unique_ptr< const ::OAuthResourceOwnerPasswordRequest > tenduke::oauth::ropg::OAuthResourceOwnerPasswordFlow::authorize ( const std::string &  scopes) const
virtual

Creates the OAuth authorization request.

Parameters
scopes-
Returns
-

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