10Duke Scale C++ Client
All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
tenduke::se::TendukeClientWithOIDCSession Class Reference

#include <TendukeClientWithOIDCSession.h>

Detailed Description

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.

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

The client contains several services, some of which share common state. For details, see the following services:

Example of how to checkout license seat with the client:

auto checkoutResponse = tendukeClient->licensing->checkoutLicenses() // builds parameters fluently
.version("1.0.0") // version to checkout, applies to all following products if not overriden
.seat("product-1") // checkout one seat of "product-1"
.execute(); // builds the parameters and executes checkout
10Duke Scale client, which authorizes requests with OIDC/OAuth and maintains the OIDC session state a...
Definition TendukeClientWithOIDCSession.h:63
const std::shared_ptr<::tenduke::se::licensing::LicensingClient > licensing
Licensing client.
Definition TendukeClient.h:60
std::unique_ptr<::tenduke::se::TendukeClientWithOIDCSession > createTendukeClientForBrowserUsingAutodiscovery(const std::string &clientIdentifier, const ::tenduke::se::BackendConfiguration &backendConfiguration, const ::tenduke::se::ClientProperties &clientProperties, const std::string &oidcAutodiscoveryURL, const ::tenduke::oidc::osbrowser::BrowserAuthenticationConfig &authenticationConfig, const std::string &initialStateAsJSON="", const ::tenduke::ServiceConfiguration &serviceConfiguration=::tenduke::ServiceConfiguration())
Creates stateful client, which authenticates user with default OS-browser, using OIDC auto-discovery.

Example of how to release the license leases checked out above:

auto releaseResponse = tendukeClient->licensing->releaseLicenses()
.leases(checkoutResponse.leases)
.execute();
Inheritance diagram for tenduke::se::TendukeClientWithOIDCSession:
tenduke::se::TendukeClient tenduke::se::TendukeClientWithOIDCSessionImpl

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::LicenseConsumerslicenseConsumers
 Service for querying information about licenses.
 
const std::shared_ptr<::tenduke::oidc::OIDCSessionoidcSession
 Service for maintaining the user login session.
 
- Public Attributes inherited from tenduke::se::TendukeClient
const std::shared_ptr<::tenduke::se::licensing::LicensingClientlicensing
 Licensing client.
 
const std::shared_ptr<::tenduke::se::licensing::Leasesleases
 Lease-cache.
 

Constructor & Destructor Documentation

◆ TendukeClientWithOIDCSession()

tenduke::se::TendukeClientWithOIDCSession::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 )
inline

Constructs new instance.

Parameters
licensingClient-
leases-
licenseConsumers-
oidcSession-

The documentation for this class was generated from the following file: