|
10Duke Scale C++ Client
|
#include <AbstractClientFactory.h>
Class template for factories, which create 10Duke Scale client.
| P | type of the configuration parameters |
Classes | |
| struct | OIDCServices |
| Helper to return OIDCClient and OIDLogin: IdToken auth needs both. More... | |
Public Member Functions | |
| AbstractClientFactory (const std::string &clientId, const ::tenduke::ServiceConfiguration &serviceConfiguration) | |
| Constructs new instance with default services. | |
| AbstractClientFactory (const ::tenduke::TendukeServices &services) | |
| Constructs new instance with given services. | |
| virtual std::unique_ptr<::tenduke::se::TendukeClientWithOIDCSession > | createClient (const ::tenduke::se::ClientProperties &clientProperties, const ::tenduke::se::BackendConfiguration &backendConfiguration, const ::tenduke::oauth::OAuthBackendConfiguration &oauthBackendConfiguration, const ::tenduke::oidc::OIDCConfiguration &oidcConfiguration, const P &authenticationConfiguration, const std::string &initialStateAsJSON={}) const |
| Creates client for 10Duke Scale from manually provided parameters. | |
| std::unique_ptr<::tenduke::se::TendukeClientWithOIDCSession > | createClientUsingAutodiscovery (const ::tenduke::se::ClientProperties &clientProperties, const ::tenduke::se::BackendConfiguration &backendConfiguration, const std::string &oidcAutodiscoveryURL, 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::oauth::OAuthConfiguration > | mkOAuthConfiguration (const ::tenduke::oauth::OAuthBackendConfiguration &oauthBackendConfig, const P &authenticationConfig) const=0 |
| Creates full OAuth-configuration. | |
| virtual void | dumpAutodiscoveryResult (const ::tenduke::oidc::AutoDiscovery &service, const ::tenduke::oidc::AutoDiscoveryResult &result) const |
| Dumps OIDC autodiscovery result to log, using DEBUG log level. | |
| virtual std::unique_ptr<::tenduke::oidc::OIDCState > | createUniqueOIDCState (const std::shared_ptr< const ::tenduke::oidc::OIDCState > &state) const |
| virtual::tenduke::se::ClientState | deserializeInitialState (const std::string &initialStateAsJson) const |
| virtual OIDCServices | createOIDCLoginService (const std::shared_ptr< const ::tenduke::oauth::OAuthConfiguration > &oauthConfiguration, const std::shared_ptr< const ::tenduke::oidc::OIDCConfiguration > &oidcConfiguration, const P &authenticationConfiguration) const=0 |
| virtual std::shared_ptr<::tenduke::oidc::OIDCSession > | createOIDCSessionService (const std::shared_ptr< const ::tenduke::oauth::OAuthConfiguration > &oauthConfiguration, const std::shared_ptr< const ::tenduke::oidc::OIDCConfiguration > &oidcConfiguration, const P &authenticationConfiguration, std::unique_ptr<::tenduke::oidc::OIDCState > initialState) const |
| virtual bool | canUseState (const ::tenduke::se::ClientState &state) const |
| Checks if stored state can be used and autodiscovery skipped. | |
| virtual std::string | getScope (const P &authenticationConfiguration) const |
Protected Attributes | |
| ::tenduke::TendukeServices | services |
|
inline |
Constructs new instance with default services.
| 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 |
| serviceConfiguration | Configuration for the underlying services. Optional. |
|
inlineexplicit |
Constructs new instance with given services.
This allows constructing the factory with custom services.
| services | - Custom service implementation(s). |
|
inlineprotectedvirtual |
Checks if stored state can be used and autodiscovery skipped.
Base implementation. Subclasses should extend this to make more accurate verifications.
| state | - |
true if the state can be used, false otherwise Reimplemented in BrowserAuthenticatingClientFactory, DeviceAuthenticatingClientFactory, ROPGAuthenticatingClientFactory, tenduke::se::BrowserAuthenticatingClientFactory, tenduke::se::DeviceAuthenticatingClientFactory, and tenduke::se::ROPGAuthenticatingClientFactory.
|
inlinevirtual |
Creates client for 10Duke Scale from manually provided parameters.
| clientProperties | Properties of the client |
| backendConfiguration | Backend configuration |
| oauthBackendConfiguration | OAuth server configuration |
| oidcConfiguration | OIDC-configuration |
| authenticationConfiguration | Authentication type specific configuration. Different authentication methods take different parameters. The concrete client factory defines the parameters it takes |
| 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 authentication to execute on first licensing request. See TendukeClient.serializeState() |
|
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.
| clientProperties | Properties of the client |
| backendConfiguration | Backend configuration |
| oidcAutodiscoveryURL | URL to OIDC discovery document |
| authenticationConfiguration | Authentication type specific configuration. Different authentication methods take different parameters. The concrete client factory defines the parameters it takes |
| 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 authentication to execute on first licensing request. See TendukeClient.serializeState() |
|
inlineprotectedvirtual |
Dumps OIDC autodiscovery result to log, using DEBUG log level.
| service | - |
| result | - |
|
protectedpure virtual |
Creates full OAuth-configuration.
| oauthBackendConfig | - |
| authenticationConfig | - |
Implemented in BrowserAuthenticatingClientFactory, DeviceAuthenticatingClientFactory, ROPGAuthenticatingClientFactory, tenduke::se::BrowserAuthenticatingClientFactory, tenduke::se::DeviceAuthenticatingClientFactory, and tenduke::se::ROPGAuthenticatingClientFactory.