10Duke Enterprise C++ Client
Loading...
Searching...
No Matches
tenduke::ee::ROPGClientFactory Class Reference

#include <ROPGClientFactory.h>

Detailed Description

Factory, which creates 10Duke Enterprise client, which authenticates user with OAuth Resource Owner Password Credentials Grant.

You need to provide a callback (implementation of tenduke::oauth::ropg::ResourceOwnerPasswordCredentialsProvider), which is used to provide the authentication credentials whenever the client needs to authenticate the user.

The client automatically maintains the user login session. The maintenance happens automatically on every API call, which needs login session. The client executes the callback, if the user needs to be authenticated. In case the the credentials are invalid, the client re-tries by re-executing the callback. After maximum number of failed login attempts the client throws tenduke::oauth::OAuthInvalidGrant. The maximum number of failed attempts can be configured in tenduke::oidc::ropg::ROPGAuthenticationConfig.

Inheritance diagram for tenduke::ee::ROPGClientFactory:
tenduke::ee::AbstractClientFactory<::tenduke::oidc::ropg::ROPGAuthenticationConfig >

Public Member Functions

 ROPGClientFactory (const std::string &clientId, const ::tenduke::ServiceConfiguration &serviceConfiguration=::tenduke::ServiceConfiguration())
 Constructs new instance with default services.
 
 ROPGClientFactory (const ::tenduke::TendukeServices &services)
 Constructs new instance with given services.
 
- Public Member Functions inherited from tenduke::ee::AbstractClientFactory<::tenduke::oidc::ropg::ROPGAuthenticationConfig >
 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 ::tenduke::oidc::ropg::ROPGAuthenticationConfig &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 ::tenduke::oidc::ropg::ROPGAuthenticationConfig &authenticationConfiguration, const std::string &initialStateAsJSON={}) const
 Creates client for 10Duke Enterprise, using OIDC autodiscovery for OAuth and OIDC parameters.
 

Protected Member Functions

std::shared_ptr<::tenduke::oidc::OIDCLogincreateOIDCLoginService (const std::shared_ptr< const ::tenduke::oauth::OAuthConfiguration > &oauthConfiguration, const std::shared_ptr< const ::tenduke::oidc::OIDCConfiguration > &oidcConfiguration, const ::tenduke::oidc::ropg::ROPGAuthenticationConfig &authenticationConfig) const override
 Creates the authentication-specific OIDC login service.
 
std::shared_ptr<::tenduke::oauth::OAuthConfigurationmkOAuthConfiguration (const ::tenduke::oauth::OAuthBackendConfiguration &oauthBackendConfiguration, const ::tenduke::oidc::ropg::ROPGAuthenticationConfig &authenticationConfig) const override
 Creates full OAuth-configuration.
 
- Protected Member Functions inherited from tenduke::ee::AbstractClientFactory<::tenduke::oidc::ropg::ROPGAuthenticationConfig >
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.
 

Additional Inherited Members

- Protected Attributes inherited from tenduke::ee::AbstractClientFactory<::tenduke::oidc::ropg::ROPGAuthenticationConfig >
::tenduke::TendukeServices services
 

Constructor & Destructor Documentation

◆ ROPGClientFactory() [1/2]

tenduke::ee::ROPGClientFactory::ROPGClientFactory ( const std::string &  clientId,
const ::tenduke::ServiceConfiguration serviceConfiguration = ::tenduke::ServiceConfiguration() 
)

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.

◆ ROPGClientFactory() [2/2]

tenduke::ee::ROPGClientFactory::ROPGClientFactory ( const ::tenduke::TendukeServices services)

Constructs new instance with given services.

This allows constructing the factory with custom services.

Parameters
servicesCustom services

Member Function Documentation

◆ createOIDCLoginService()

std::shared_ptr<::OIDCLogin > tenduke::ee::ROPGClientFactory::createOIDCLoginService ( const std::shared_ptr< const ::tenduke::oauth::OAuthConfiguration > &  oauthConfig,
const std::shared_ptr< const ::tenduke::oidc::OIDCConfiguration > &  oidcConfig,
const ::tenduke::oidc::ropg::ROPGAuthenticationConfig authenticationConfig 
) const
overrideprotectedvirtual

Creates the authentication-specific OIDC login service.

Parameters
oauthConfig-
oidcConfig-
authenticationConfig-
Returns
-

Implements tenduke::ee::AbstractClientFactory<::tenduke::oidc::ropg::ROPGAuthenticationConfig >.

◆ mkOAuthConfiguration()

std::shared_ptr<::OAuthConfiguration > tenduke::ee::ROPGClientFactory::mkOAuthConfiguration ( const ::tenduke::oauth::OAuthBackendConfiguration oauthBackendConfig,
const ::tenduke::oidc::ropg::ROPGAuthenticationConfig authenticationConfig 
) const
overrideprotectedvirtual

Creates full OAuth-configuration.

Parameters
oauthBackendConfig-
authenticationConfig-
Returns
-

Implements tenduke::ee::AbstractClientFactory<::tenduke::oidc::ropg::ROPGAuthenticationConfig >.


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