cesium-native 0.46.0
|
Class for authenticating with an API that uses OAuth2 Proof of Key Code Exchange (PKCE). More...
#include <CesiumClientCommon/OAuth2PKCE.h>
Static Public Member Functions | |
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 to authorize . | |
Class for authenticating with an API that uses OAuth2 Proof of Key Code Exchange (PKCE).
For more information:
Definition at line 78 of file OAuth2PKCE.h.
|
static |
Initiates the OAuth2 PKCE authentication process.
This will start an internal HTTP server to listen on the redirect URI for a response from the authorization endpoint. This HTTP is not currently shutdown until the user visits this redirect URI.
asyncSystem | The CesiumAsync::AsyncSystem to use. |
pAssetAccessor | The CesiumAsync::IAssetAccessor to use for API requests. |
friendlyApplicationName | The name of the application that will be displayed to the user in status messages from the internal HTTP server. |
clientOptions | Options to configure the OAuth2 authentication process. |
scopes | A set of scopes that the token obtained from the authentication process will have access to. |
openUrlCallback | A callback that will be called with the created redirect URI after the internal server has been created. This callback should either present the URL to the user or open the URL in a web browser. |
tokenEndpointUrl | The endpoint that will be requested to attempt to obtain an access token after the code has been acquired from the redirect URI. |
authorizeBaseUrl | The base URL of the page the user will be prompted to open to confirm the authorization attempt. |
Future
returning a Result
containing either a OAuth2TokenResponse
or error messages.
|
static |
Attempts to obtain new access and refresh tokens using a refresh token obtained from a previous call to authorize
.
asyncSystem | The CesiumAsync::AsyncSystem to use. |
pAssetAccessor | The CesiumAsync::IAssetAccessor to use for API requests. |
clientOptions | Options to configure the OAuth2 authentication process. |
refreshBaseUrl | The base URL of the endpoint that will be requested to attempt to obtain new access and refresh tokens. |
refreshToken | The refresh token. |
Future
returning a Result
containing either a OAuth2TokenResponse
or error messages.