10Duke Enterprise C++ Client
|
Classes, functions and globals of 10Duke Enterprise C++ Client.
This namespace contains classes, functions and globals related to 10Duke Enterprise.
Namespaces | |
namespace | licensing |
Classes, functions and globals related to 10Duke Enterprise licensing. | |
Classes | |
class | AbstractClientFactory |
Class template for factories, which create 10Duke client. More... | |
class | APIRequest |
Generic base for API requests. More... | |
class | BrowserBasedClientFactory |
Factory, which creates 10Duke Enterprise client, which authenticates user by opening default OS browser. More... | |
class | CCGClientFactory |
Factory, which creates 10Duke Enterprise client, which authenticates user with OAuth Client Credentials Grant. More... | |
struct | ClientProperties |
Client properties. More... | |
struct | ClientState |
Client state. More... | |
class | DeserializeStateFromJSON |
Service for deserializing client state from JSON. More... | |
class | DeviceAuthenticationClientFactory |
class | ROPGClientFactory |
Factory, which creates 10Duke Enterprise client, which authenticates user with OAuth Resource Owner Password Credentials Grant. More... | |
class | SerializeStateToJSON |
Serializes client state to JSON. More... | |
struct | TendukeClient |
The 10Duke Enterprise Client. More... | |
Functions | |
std::unique_ptr<::tenduke::ee::TendukeClient > | createClient (const ::tenduke::TendukeServices &services, const std::shared_ptr<::tenduke::ee::licensing::LicensingConfiguration > &licensingConfiguration, const std::shared_ptr< const ::tenduke::oauth::OAuthConfiguration > &oauthConfiguration, const std::shared_ptr< const ::tenduke::oidc::OIDCConfiguration > &oidcConfiguration, const std::shared_ptr<::tenduke::oidc::OIDCLogin > &oidcLogin, const ::tenduke::oidc::OIDCSessionConfiguration &oidcSessionConfiguration={}, const ::tenduke::ee::ClientState &initialState={}) |
Factory function for creating tenduke::ee::TendukeClient . | |
std::unique_ptr<::tenduke::ee::TendukeClient > | createClient (const ::tenduke::TendukeServices &services, const std::shared_ptr<::tenduke::ee::licensing::LicensingConfiguration > &licensingConfiguration, const std::shared_ptr< const ::tenduke::oauth::OAuthConfiguration > &oauthConfiguration, const std::shared_ptr< const ::tenduke::oidc::OIDCConfiguration > &oidcConfiguration, const std::shared_ptr<::tenduke::oidc::OIDCSession > &oidcSession, const ::tenduke::ee::ClientState &initialState={}) |
Factory function for creating tenduke::ee::TendukeClient . | |
std::unique_ptr<::tenduke::ee::TendukeClient > | createClientUsingAutodiscovery (const std::string &clientId, const ::tenduke::ee::ClientProperties &clientProperties, const std::string &serviceUrl, const ::tenduke::oidc::osbrowser::BrowserAuthenticationConfig &authenticationConfig, const std::string &initialStateAsJSON={}, const ::tenduke::ServiceConfiguration &serviceConfiguration=::tenduke::ServiceConfiguration()) |
Creates client for 10Duke Enterprise, which authenticates user with default operating system browser. | |
std::vector< tenduke::ee::licensing::Lease > | deserializeOfflineLicenseTokens (const std::string &serializedLeases) |
Deserializes off-line license tokens. | |
std::unique_ptr<::tenduke::ee::TendukeClient > | createClientForDeviceUsingAutodiscovery (const std::string &clientIdentifier, const ::tenduke::ee::ClientProperties &clientProperties, const std::string &serviceUrl, const ::tenduke::oidc::device::DeviceAuthenticationConfig &authenticationConfig, const std::string &initialStateAsJSON={}, const ::tenduke::ServiceConfiguration &serviceConfiguration=::tenduke::ServiceConfiguration()) |
Creates client for 10Duke Enterprise, which authenticates user with OAuth Device Flow. | |
std::unique_ptr<::tenduke::ee::TendukeClient > | createClientForDevice (const std::string &clientIdentifier, const ::tenduke::ee::ClientProperties &clientProperties, const std::string &serviceUrl, const ::tenduke::oauth::OAuthBackendConfiguration &oauthBackendConfiguration, const ::tenduke::oidc::OIDCConfiguration &oidcConfiguration, const ::tenduke::oidc::device::DeviceAuthenticationConfig &authenticationConfig, const std::string &initialStateAsJSON="", const ::tenduke::ServiceConfiguration &serviceConfiguration=::tenduke::ServiceConfiguration()) |
Creates client, which authenticates user with OAuth Device Flow. | |
std::unique_ptr<::tenduke::ee::TendukeClient > tenduke::ee::createClient | ( | const ::tenduke::TendukeServices & | services, |
const std::shared_ptr<::tenduke::ee::licensing::LicensingConfiguration > & | licensingConfiguration, | ||
const std::shared_ptr< const ::tenduke::oauth::OAuthConfiguration > & | oauthConfiguration, | ||
const std::shared_ptr< const ::tenduke::oidc::OIDCConfiguration > & | oidcConfiguration, | ||
const std::shared_ptr<::tenduke::oidc::OIDCLogin > & | oidcLogin, | ||
const ::tenduke::oidc::OIDCSessionConfiguration & | oidcSessionConfiguration = {} , |
||
const ::tenduke::ee::ClientState & | initialState = {} |
||
) |
Factory function for creating tenduke::ee::TendukeClient
.
This function is used internally by e.g. tenduke::ee::createClientUsingAutodiscovery()
, but can be used by application developers to create client with custom tenduke::oidc::OIDCLogin
-service. One reason to do this is to make custom browser-integration, e.g. using embedded browser.
services | - |
licensingConfiguration | - |
oauthConfiguration | - |
oidcConfiguration | - |
oidcLogin | - |
oidcSessionConfiguration | - |
initialState | - |
std::unique_ptr<::tenduke::ee::TendukeClient > tenduke::ee::createClient | ( | const ::tenduke::TendukeServices & | services, |
const std::shared_ptr<::tenduke::ee::licensing::LicensingConfiguration > & | licensingConfiguration, | ||
const std::shared_ptr< const ::tenduke::oauth::OAuthConfiguration > & | oauthConfiguration, | ||
const std::shared_ptr< const ::tenduke::oidc::OIDCConfiguration > & | oidcConfiguration, | ||
const std::shared_ptr<::tenduke::oidc::OIDCSession > & | oidcSession, | ||
const ::tenduke::ee::ClientState & | initialState = {} |
||
) |
Factory function for creating tenduke::ee::TendukeClient
.
services | - |
licensingConfiguration | - |
oauthConfiguration | - |
oidcConfiguration | - |
initialState | - |
oidcSession | - |
std::unique_ptr<::tenduke::ee::TendukeClient > tenduke::ee::createClientForDevice | ( | const std::string & | clientIdentifier, |
const ::tenduke::ee::ClientProperties & | clientProperties, | ||
const std::string & | serviceUrl, | ||
const ::tenduke::oauth::OAuthBackendConfiguration & | oauthBackendConfiguration, | ||
const ::tenduke::oidc::OIDCConfiguration & | oidcConfiguration, | ||
const ::tenduke::oidc::device::DeviceAuthenticationConfig & | authenticationConfig, | ||
const std::string & | initialStateAsJSON = "" , |
||
const ::tenduke::ServiceConfiguration & | serviceConfiguration = ::tenduke::ServiceConfiguration() |
||
) |
Creates client, which authenticates user with OAuth Device Flow.
The client is initialized using provided configuration.
See tenduke::ee::createClientForDeviceUsingAutodiscovery(const std::string &,const tenduke::ee::ClientProperties &,const std::string &,const tenduke::oidc::device::DeviceAuthenticationConfig &,const std::string &,const tenduke::ServiceConfiguration &)
for more details.
Example:
clientIdentifier | identifies the client, used as User-Agent in HTTP-requests |
clientProperties | Client properties |
serviceUrl | URL of the deployment. Usually something like: https://your-company-name.10duke.com |
oauthBackendConfiguration | OAuth backend configuration (for user authentication) |
oidcConfiguration | OIDC configuration (for user authentication) |
authenticationConfig | Configuration for device authentication. |
initialStateAsJSON | Initial client state as JSON. Optional. |
serviceConfiguration | Configuration for the underlying services. Optional. |
std::unique_ptr<::tenduke::ee::TendukeClient > tenduke::ee::createClientForDeviceUsingAutodiscovery | ( | const std::string & | clientIdentifier, |
const ::tenduke::ee::ClientProperties & | clientProperties, | ||
const std::string & | serviceUrl, | ||
const ::tenduke::oidc::device::DeviceAuthenticationConfig & | authenticationConfig, | ||
const std::string & | initialStateAsJSON = {} , |
||
const ::tenduke::ServiceConfiguration & | serviceConfiguration = ::tenduke::ServiceConfiguration() |
||
) |
Creates client for 10Duke Enterprise, which authenticates user with OAuth Device Flow.
The client is initialized using OIDC auto-discovery.
The client automatically performs login when the user needs to log in. The login is performed with OAuth Device Flow. In OAuth Device Flow the user is shown a URL and a code. The user uses any browser, which can be on different device, to navigate to the URL, log in and provide the code.
The application developer needs to register a callback (see tenduke::oidc::device::DeviceAuthenticationConfig
for details), which is passed the details (URL and code). The application needs to display the details to the user. Once the user has successfully authenticated in the browser, the client continues and acknowledges the successful login.
Example use:
See also tenduke::ee::createClientUsingAutodiscovery
.
clientIdentifier | Identifier of the client. Used mainly as HTTP user-agent. This value is very useful when analysing or troubleshooting activity from access logs. We recommend that value is relatively short and contains short application identifier, version and platform identifier. Use "HTTP-friendly"-characters, e.g. [0-9A-Z a-z .-_~/]. Example: the-app/1.0.0/win11 |
clientProperties | Properties of the client. |
serviceUrl | URL of the deployment. Usually something like: https://genco.10duke.com |
authenticationConfig | Configuration for device authentication. See the tenduke::oidc::device::DeviceAuthenticationConfig for details. |
initialStateAsJSON | Previously stored state, if any. Once the user has successfully logged in, the state can be persisted so that the user does not have to authenticate every time the application is started. If there is no previous state, pass empty string, which forces the user to authenticate on first licensing request. See TendukeClient.serializeState(). |
serviceConfiguration | Configuration for the underlying services. Optional. |
std::unique_ptr<::tenduke::ee::TendukeClient > tenduke::ee::createClientUsingAutodiscovery | ( | const std::string & | clientId, |
const ::tenduke::ee::ClientProperties & | clientProperties, | ||
const std::string & | serviceUrl, | ||
const ::tenduke::oidc::osbrowser::BrowserAuthenticationConfig & | authenticationConfig, | ||
const std::string & | initialStateAsJSON = {} , |
||
const ::tenduke::ServiceConfiguration & | serviceConfiguration = ::tenduke::ServiceConfiguration() |
||
) |
Creates client for 10Duke Enterprise, which authenticates user with default operating system browser.
This factory-function creates client, which automatically opens browser when the user needs to log in. The browser is the default browser provided by operating system.
This factory function performs OIDC/OAuth configuration by reading OIDC discovery document via HTTP request, which simplifies the configuration.
Example use with typical set of parameters (for complete example, see example identity_based_client.cpp
):
You can register a listener, which gets notified on OIDC-session events, e.g. when login is starting or complete. Create a class, which inherits from tenduke::oidc::DefaultOIDCSessionEventListener and provide a reference to the instance of the listener to the authenticationConfig
parameter. Example:
clientId | Identifier of the client. Used mainly as HTTP user-agent. This value is very useful when analysing or troubleshooting activity from access logs. We recommend that value is relatively short and contains short application identifier, version and platform identifier. Use "HTTP-friendly"-characters, e.g. [0-9A-Z a-z .-_~/]. Example: the-app/1.0.0/win11 |
clientProperties | Properties of the client. |
serviceUrl | URL of the deployment. Usually something like: https://genco.10duke.com |
authenticationConfig | Configuration for browser-based authentication. See the tenduke::oidc::osbrowser::BrowserAuthenticationConfig for details. |
initialStateAsJSON | Previously stored state, if any. Once the user has successfully logged in, the state can be persisted so that the user does not have to execute every time the application is started. If there is no previous state, pass empty string, which forces the user to execute on first licensing request. See TendukeClient.serializeState(). |
serviceConfiguration | Configuration for the underlying services. Optional. |
std::vector<::Lease > tenduke::ee::deserializeOfflineLicenseTokens | ( | const std::string & | serializedLeases | ) |
Deserializes off-line license tokens.
This de-serializes license tokens earlier serialized by LicenseTokens::serialize
(e.g. TendukeClient::licenseTokens::serialize()
). Serialized licenses are usually used to store the leases for offline use.
This function does not need any network connection.
serializedLeases | - |