10Duke Scale C++ Client
|
#include <TendukeClientWithOIDCSession.h>
10Duke Scale client, which authorizes requests with OIDC/OAuth and maintains the OIDC session state automatically.
This client maintains the login state, that is, user session automatically. The application developer does not need to manually start login or refresh any state: First use of any API, which requires authentication, will automatically open a browser and require the user to log in. The client will automatically refresh the login session behind the scenes. If the login session expires, the client will open browser and require the user to log in.
You can register a listener for the session events (e.g. login starting or login complete). For details, see the factory functions below.
The client also maintains a local cache of the license leases checked out. See tenduke::se::licensing::LicensingClient
for further details.
Because this client is stateful, you must keep the client alive for the duration of the application.
To create the client with browser-based login, use factory functions in createTendukeClientForBrowser.h
.
tenduke::se::createTendukeClientForBrowserUsingAutodiscovery()
tenduke::se::createTendukeClientForBrowser()
To create the client with OAuth/OIDC device flow (typically in platforms without browser, where authentication is done using a browser on another device), use factory functions in createTendukeClientForDevice.h
tenduke::se::createTendukeClientForDeviceClientUsingAutodiscovery()
tenduke::se::createTendukeClientForDevice()
The client contains several services, some of which share common state. For details, see the following services:
tenduke::se::licensing::LicensingClient
tenduke::se::licensing::Leases
tenduke::se::licensing::LicenseConsumers
tenduke::oidc::OIDCSession
Example of how to checkout license seat with the client:
Example of how to release the license leases checked out above:
Public Member Functions | |
TendukeClientWithOIDCSession (const std::shared_ptr<::tenduke::se::licensing::LicensingClient > &licensingClient, const std::shared_ptr<::tenduke::se::licensing::Leases > &leases, const std::shared_ptr<::tenduke::se::licensing::LicenseConsumers > &licenseConsumers, const std::shared_ptr<::tenduke::oidc::OIDCSession > &oidcSession) | |
Constructs new instance. | |
Public Member Functions inherited from tenduke::se::TendukeClient | |
TendukeClient (const std::shared_ptr<::tenduke::se::licensing::LicensingClient > &licensingClient, const std::shared_ptr<::tenduke::se::licensing::Leases > &leases) | |
Creates new client. | |
virtual std::string | serializeState ()=0 |
Serializes the client state into a JSON. | |
Public Attributes | |
const std::shared_ptr<::tenduke::se::licensing::LicenseConsumers > | licenseConsumers |
Service for querying information about licenses. | |
const std::shared_ptr<::tenduke::oidc::OIDCSession > | oidcSession |
Service for maintaining the user login session. | |
Public Attributes inherited from tenduke::se::TendukeClient | |
const std::shared_ptr<::tenduke::se::licensing::LicensingClient > | licensing |
Licensing client. | |
const std::shared_ptr<::tenduke::se::licensing::Leases > | leases |
Lease-cache. | |
|
inline |
Constructs new instance.
licensingClient | - |
leases | - |
licenseConsumers | - |
oidcSession | - |