1#ifndef TENDUKE_OAUTH_PKCE_OAUTHPKCEREQUEST_H
2#define TENDUKE_OAUTH_PKCE_OAUTHPKCEREQUEST_H
4#include "../BaseOAuthRequest.h"
5#include "../OAuthBrowserAuthorizationRequest.h"
6#include "../OAuthConfiguration.h"
7#include "../OAuthTokenRequest.h"
8#include "../OAuthState.h"
10#include "crypto/MessageDigestFactory.h"
11#include "http/HTTPClient.h"
12#include "json/JSONParser.h"
13#include "net/URLParser.h"
14#include "time/Clock.h"
15#include "utl/Base64Encoder.h"
47 std::map<std::string, std::string> additionalParameters,
48 std::string codeVerifier,
49 std::shared_ptr<const tenduke::oauth::OAuthConfiguration> config,
50 std::shared_ptr<const tenduke::http::HTTPClient> httpClient,
51 std::shared_ptr<const tenduke::net::URLParser> urlParser,
52 std::shared_ptr<const tenduke::json::JSONParser> jsonParser,
53 std::shared_ptr<const tenduke::utl::Base64Encoder> base64Encoder,
54 std::shared_ptr<const tenduke::crypto::MessageDigestFactory> messageDigestFactory,
55 std::shared_ptr<tenduke::time::Clock> clock
61 std::unique_ptr<tenduke::oauth::OAuthState>
handleCallback(
const std::string &redirectUri)
const override;
89 virtual std::unique_ptr<tenduke::oauth::OAuthState>
handleSuccessfulCallback(
const std::multimap<std::string, std::string> &queryParameters)
const;
102 virtual std::unique_ptr<tenduke::oauth::OAuthTokenRequest>
createTokenRequest(
const std::string &code)
const;
105 const std::string state;
107 const std::string codeVerifier;
109 const std::shared_ptr<const tenduke::net::URLParser> parseURL;
110 const std::shared_ptr<const tenduke::utl::Base64Encoder> base64Encoder;
111 const std::shared_ptr<const tenduke::crypto::MessageDigestFactory> messageDigest;
Base OAuthRequest.
Definition BaseOAuthRequest.h:23
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 to handle OAuth authorization using browser.
Definition OAuthBrowserAuthorizationRequest.h:20
PKCE-implementation of tenduke::oauth::OAuthRequest.
Definition OAuthPKCERequest.h:28
virtual void createCodeChallenge(std::map< std::string, std::string > ¶meters) const
Creates PKCE code challenge and adds it to the provided parameters.
Definition OAuthPKCERequest.cpp:170
virtual bool isPKCERequest() const
Checks if this is PKCE-request.
Definition OAuthPKCERequest.cpp:129
std::unique_ptr< tenduke::oauth::OAuthState > handleCallback(const std::string &redirectUri) const override
Handles callback: performs consequent actions to authorize.
Definition OAuthPKCERequest.cpp:44
virtual std::map< std::string, std::string > buildAuthorizationRequestParameters() const
Builds parameters for the authorization request.
Definition OAuthPKCERequest.cpp:147
virtual std::unique_ptr< tenduke::oauth::OAuthState > handleSuccessfulCallback(const std::multimap< std::string, std::string > &queryParameters) const
Handles successful callback to redirect-uri from authorization request, performing the next steps to ...
Definition OAuthPKCERequest.cpp:64
std::string buildAuthorizationRequestUrl() const override
Creates the initial authorization request URL.
Definition OAuthPKCERequest.cpp:136
OAuth services.
Definition AccessTokenRequestAuthenticator.h:8
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4