5#include <CesiumAsync/AsyncSystem.h>
6#include <CesiumAsync/Future.h>
7#include <CesiumAsync/IAssetAccessor.h>
8#include <CesiumUtility/Result.h>
111 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
112 const std::string& friendlyApplicationName,
114 const std::vector<std::string>& scopes,
115 std::function<
void(
const std::string&)>&& openUrlCallback,
116 const std::string& tokenEndpointUrl,
117 const std::string& authorizeBaseUrl);
138 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
140 const std::string& refreshBaseUrl,
141 const std::string& refreshToken);
145 completeTokenExchange(
147 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
149 const std::string& tokenEndpointUrl,
150 const std::string& code,
151 const std::string& redirectUrl,
152 const std::string& codeVerifier);
A system for managing asynchronous requests and tasks.
A value that will be available in the future, as produced by AsyncSystem.
Class for authenticating with an API that uses OAuth2 Proof of Key Code Exchange (PKCE).
static CesiumAsync::Future< CesiumUtility::Result< OAuth2TokenResponse > > authorize(const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const std::string &friendlyApplicationName, const OAuth2ClientOptions &clientOptions, const std::vector< std::string > &scopes, std::function< void(const std::string &)> &&openUrlCallback, const std::string &tokenEndpointUrl, const std::string &authorizeBaseUrl)
Initiates the OAuth2 PKCE authentication process.
static CesiumAsync::Future< CesiumUtility::Result< OAuth2TokenResponse > > refresh(const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const OAuth2ClientOptions &clientOptions, const std::string &refreshBaseUrl, const std::string &refreshToken)
Attempts to obtain new access and refresh tokens using a refresh token obtained from a previous call ...
Shared classes for interacting with Cesium ion and iTwin APIs.
Options used to configure the OAuth2 authentication process.
bool useJsonBody
Whether requests against the token and refresh endpoints should use a JSON body to the POST request.
std::optional< int > redirectPort
The port that the internal HTTP server will listen on.
std::string clientID
The OAuth2 client ID.
std::string redirectPath
The URL path that will be used to create the redirect URI.
Tokens obtained from a successful OAuth2 authentication operation.
std::string accessToken
The access token returned. This can be used to authenticate requests.
std::optional< std::string > refreshToken
The refresh token returned, if any.