10Duke Enterprise C++ Client
Loading...
Searching...
No Matches
tenduke::ee::AbstractClientFactory< P > Class Template Referenceabstract

#include <AbstractClientFactory.h>

Detailed Description

template<class P>
class tenduke::ee::AbstractClientFactory< P >

Class template for factories, which create 10Duke client.

Template Parameters
Ptype of the configuration parameters

Public Member Functions

 AbstractClientFactory (const std::string &clientId, const ::tenduke::ServiceConfiguration &serviceConfiguration=::tenduke::ServiceConfiguration())
 Constructs new instance with default services.
 
 AbstractClientFactory (const ::tenduke::TendukeServices &services)
 Constructs new instance with given services.
 
virtual std::unique_ptr<::tenduke::ee::TendukeClientcreateClient (const ::tenduke::ee::ClientProperties &clientProperties, const std::string &serviceUrl, const ::tenduke::oauth::OAuthBackendConfiguration &oauthBackendConfiguration, const ::tenduke::oidc::OIDCConfiguration &oidcConfiguration, const P &authenticationConfiguration, const std::string &initialStateAsJSON={}) const
 Creates client for 10Duke Enterprise from manually provided parameters.
 
std::unique_ptr<::tenduke::ee::TendukeClientcreateClientUsingAutodiscovery (const ::tenduke::ee::ClientProperties &clientProperties, const std::string &serviceUrl, const P &authenticationConfiguration, const std::string &initialStateAsJSON={}) const
 Creates client for 10Duke Enterprise, using OIDC autodiscovery for OAuth and OIDC parameters.
 

Protected Member Functions

virtual std::shared_ptr<::tenduke::oidc::OIDCLogincreateOIDCLoginService (const std::shared_ptr< const ::tenduke::oauth::OAuthConfiguration > &oauthConfig, const std::shared_ptr< const ::tenduke::oidc::OIDCConfiguration > &oidcConfig, const P &authenticationConfig) const =0
 Creates the authentication-specific OIDC login service.
 
virtual std::shared_ptr<::tenduke::oauth::OAuthConfigurationmkOAuthConfiguration (const ::tenduke::oauth::OAuthBackendConfiguration &oauthBackendConfig, const P &authenticationConfig) const =0
 Creates full OAuth-configuration.
 
virtual std::shared_ptr<::tenduke::ee::licensing::LicensingConfigurationmkLicensingConfiguration (const std::string &serviceUrl, const ::tenduke::ee::ClientProperties &clientProperties, const ::tenduke::oidc::OIDCConfiguration &oidcConfig) const
 Creates licensing configuration from provided parameters.
 
virtual void dumpAutodiscoveryResult (const ::tenduke::oidc::AutoDiscovery &service, const ::tenduke::oidc::AutoDiscoveryResult &result) const
 Dumps OIDC autodiscovery result to log, using DEBUG log level.
 

Protected Attributes

::tenduke::TendukeServices services
 

Constructor & Destructor Documentation

◆ AbstractClientFactory() [1/2]

template<class P >
tenduke::ee::AbstractClientFactory< P >::AbstractClientFactory ( const std::string &  clientId,
const ::tenduke::ServiceConfiguration serviceConfiguration = ::tenduke::ServiceConfiguration() 
)
inline

Constructs new instance with default services.

Parameters
clientIdIdentifier 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
serviceConfigurationConfiguration for the underlying services. Optional.

◆ AbstractClientFactory() [2/2]

template<class P >
tenduke::ee::AbstractClientFactory< P >::AbstractClientFactory ( const ::tenduke::TendukeServices services)
inlineexplicit

Constructs new instance with given services.

This allows constructing the factory with custom services.

Parameters
services- Custom service implementation(s).

Member Function Documentation

◆ createClient()

template<class P >
virtual std::unique_ptr<::tenduke::ee::TendukeClient > tenduke::ee::AbstractClientFactory< P >::createClient ( const ::tenduke::ee::ClientProperties clientProperties,
const std::string &  serviceUrl,
const ::tenduke::oauth::OAuthBackendConfiguration oauthBackendConfiguration,
const ::tenduke::oidc::OIDCConfiguration oidcConfiguration,
const P &  authenticationConfiguration,
const std::string &  initialStateAsJSON = {} 
) const
inlinevirtual

Creates client for 10Duke Enterprise from manually provided parameters.

Parameters
clientPropertiesProperties of the client.
serviceUrlURL of the deployment. Usually something like: https://your-company-name.10duke.com
oauthBackendConfigurationOAuth server configuration.
oidcConfigurationOIDC-configuration.
authenticationConfigurationAuthentication type specific configuration. Different authentication methods take different parameters. The concrete client factory defines the parameters it takes.
initialStateAsJSONPreviously 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 authentication to execute on first licensing request. See TendukeClient.serializeState().
Returns
the client

◆ createClientUsingAutodiscovery()

template<class P >
std::unique_ptr<::tenduke::ee::TendukeClient > tenduke::ee::AbstractClientFactory< P >::createClientUsingAutodiscovery ( const ::tenduke::ee::ClientProperties clientProperties,
const std::string &  serviceUrl,
const P &  authenticationConfiguration,
const std::string &  initialStateAsJSON = {} 
) const
inline

Creates client for 10Duke Enterprise, using OIDC autodiscovery for OAuth and OIDC parameters.

The OIDC autodiscovery is performed over network with a HTTP-call.

Parameters
clientPropertiesProperties of the client.
serviceUrlURL of the deployment.
authenticationConfigurationAuthentication type specific configuration. Different authentication methods take different parameters. The concrete client factory defines the parameters it takes.
initialStateAsJSONPreviously 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 authentication to execute on first licensing request. See TendukeClient.serializeState().
Returns
the client

◆ createOIDCLoginService()

template<class P >
virtual std::shared_ptr<::tenduke::oidc::OIDCLogin > tenduke::ee::AbstractClientFactory< P >::createOIDCLoginService ( const std::shared_ptr< const ::tenduke::oauth::OAuthConfiguration > &  oauthConfig,
const std::shared_ptr< const ::tenduke::oidc::OIDCConfiguration > &  oidcConfig,
const P &  authenticationConfig 
) const
protectedpure virtual

Creates the authentication-specific OIDC login service.

Parameters
oauthConfig-
oidcConfig-
authenticationConfig-
Returns
-

Implemented in tenduke::ee::CCGClientFactory, tenduke::ee::DeviceAuthenticationClientFactory, tenduke::ee::BrowserBasedClientFactory, and tenduke::ee::ROPGClientFactory.

◆ dumpAutodiscoveryResult()

template<class P >
virtual void tenduke::ee::AbstractClientFactory< P >::dumpAutodiscoveryResult ( const ::tenduke::oidc::AutoDiscovery service,
const ::tenduke::oidc::AutoDiscoveryResult result 
) const
inlineprotectedvirtual

Dumps OIDC autodiscovery result to log, using DEBUG log level.

Parameters
service-
result-

◆ mkLicensingConfiguration()

template<class P >
virtual std::shared_ptr<::tenduke::ee::licensing::LicensingConfiguration > tenduke::ee::AbstractClientFactory< P >::mkLicensingConfiguration ( const std::string &  serviceUrl,
const ::tenduke::ee::ClientProperties clientProperties,
const ::tenduke::oidc::OIDCConfiguration oidcConfig 
) const
inlineprotectedvirtual

Creates licensing configuration from provided parameters.

Parameters
serviceUrl-
clientProperties-
oidcConfig-
Returns
-

◆ mkOAuthConfiguration()

template<class P >
virtual std::shared_ptr<::tenduke::oauth::OAuthConfiguration > tenduke::ee::AbstractClientFactory< P >::mkOAuthConfiguration ( const ::tenduke::oauth::OAuthBackendConfiguration oauthBackendConfig,
const P &  authenticationConfig 
) const
protectedpure virtual

Creates full OAuth-configuration.

Parameters
oauthBackendConfig-
authenticationConfig-
Returns
-

Implemented in tenduke::ee::CCGClientFactory, tenduke::ee::DeviceAuthenticationClientFactory, tenduke::ee::BrowserBasedClientFactory, and tenduke::ee::ROPGClientFactory.


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