10Duke Enterprise C++ Client
Loading...
Searching...
No Matches
BaseOAuthRequest.h
1#ifndef TENDUKE_OAUTH_BASEOAUTHREQUEST_H
2#define TENDUKE_OAUTH_BASEOAUTHREQUEST_H
3
4#include "./OAuthAuthorizationRequest.h"
5#include "./OAuthConfiguration.h"
6#include "./OAuthState.h"
7#include "./OAuthTokenRequest.h"
8#include "http/HTTPClient.h"
9#include "json/JSONParser.h"
10#include "time/Clock.h"
11
12#include <map>
13#include <memory>
14#include <string>
15
16namespace tenduke { namespace oauth {
17
23{
24protected:
35 const std::string &scopes,
36 const std::map<std::string, std::string> &additionalParameters,
37 const std::shared_ptr<const ::tenduke::oauth::OAuthConfiguration> &config,
38 const std::shared_ptr<const ::tenduke::http::HTTPClient> &http,
39 const std::shared_ptr<const ::tenduke::json::JSONParser> &parseJson,
40 const std::shared_ptr<::tenduke::time::Clock> &clock
41 );
42
43protected:
52 virtual std::map<std::string, std::string> buildTokenRequestParameters() const;
53
58 virtual std::unique_ptr<::tenduke::oauth::OAuthTokenRequest> createTokenRequest() const;
59
65 virtual std::unique_ptr<::tenduke::oauth::OAuthState> handleTokenResponse(std::unique_ptr<::tenduke::oauth::OAuthTokenResponse> response) const;
66
67protected:
68 const std::string scopes;
69 const std::map<std::string, std::string> additionalParameters;
70
71 const std::shared_ptr<const ::tenduke::oauth::OAuthConfiguration> config;
72 const std::shared_ptr<const ::tenduke::http::HTTPClient> http;
73 const std::shared_ptr<const ::tenduke::json::JSONParser> parseJSON;
74 const std::shared_ptr<::tenduke::time::Clock> clock;
75};
76
77}}
78
79#endif //TENDUKE_OAUTH_BASEOAUTHREQUEST_H
Base OAuthRequest.
Definition BaseOAuthRequest.h:23
virtual std::unique_ptr<::tenduke::oauth::OAuthState > handleTokenResponse(std::unique_ptr<::tenduke::oauth::OAuthTokenResponse > response) const
Handles token response.
Definition BaseOAuthRequest.cpp:42
virtual std::map< std::string, std::string > buildTokenRequestParameters() const
Builds base parameters for the token request.
Definition BaseOAuthRequest.cpp:15
virtual std::unique_ptr<::tenduke::oauth::OAuthTokenRequest > createTokenRequest() const
Creates the token request.
Definition BaseOAuthRequest.cpp:30
OAuth-request handles the OAuth authorization flow.
Definition OAuthAuthorizationRequest.h:12
OAuth services.
Definition AccessTokenRequestAuthenticator.h:8
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4