Ditto  1.0.19
Public Attributes | List of all members
ditto::OnlineWithAuthenticationIdentity Class Reference

Run Ditto in secure production mode, logging on to Ditto Cloud or on on-premises authentication server. User permissions are centrally managed. Sync will not work until a successful login has occurred. More...

Inheritance diagram for ditto::OnlineWithAuthenticationIdentity:
ditto::Identity

Public Attributes

std::string app_id
 
bool enable_ditto_cloud_sync
 
std::string custom_auth_url
 
- Public Attributes inherited from ditto::Identity
IdentityType type
 

Additional Inherited Members

- Static Public Member Functions inherited from ditto::Identity
static DevelopmentIdentity Development (std::string app_id="", uint64_t site_id=0, std::string persistence_dir="")
 Construct a new DevelopmentIdentity. More...
 
static OfflinePlaygroundIdentity OfflinePlayground (std::string app_id="", uint64_t site_id=0, std::string persistence_dir="")
 Construct a new OfflinePlaygroundIdentity. More...
 
static OnlineIdentity Online (std::string app_id, std::shared_ptr< AuthenticationCallback > callback, bool enable_ditto_cloud_sync=true, std::string custom_auth_url="", std::string persistence_dir="")
 Construct a new OnlineIdentity. More...
 
static OnlineWithAuthenticationIdentity OnlineWithAuthentication (std::string app_id, std::shared_ptr< AuthenticationCallback > callback, bool enable_ditto_cloud_sync=true, std::string custom_auth_url="", std::string persistence_dir="")
 Construct a new OnlineWithAuthenticationIdentity. More...
 
static OnlinePlaygroundIdentity OnlinePlayground (std::string app_id, bool enable_ditto_cloud_sync=true, std::string persistence_dir="")
 Construct a new OnlinePlaygroundIdentity. More...
 
static SharedKeyIdentity SharedKey (std::string app_id, std::string shared_key, uint64_t site_id=0, std::string persistence_dir="")
 Construct a new SharedKeyIdentity. More...
 
static ManualIdentity Manual (std::string certificate_config)
 Construct a new ManualIdentity. More...
 

Detailed Description

Run Ditto in secure production mode, logging on to Ditto Cloud or on on-premises authentication server. User permissions are centrally managed. Sync will not work until a successful login has occurred.

The only required configuration is the application's ID (UUID), which can be found on the Ditto portal where the app is registered.

By default cloud sync is enabled. This means the SDK will sync to a Big Peer in Ditto's cloud when an internet connection is available. This is controlled by the enable_ditto_cloud_sync parameter. If true (default), a suitable wss:// URL will be added to the TransportConfig. To prevent cloud sync, or to specify your own URL later, pass false.

Authentication requests are handled by Ditto's cloud by default, configured in the portal at https://portal.ditto.live.

To use a different or on-premises authentication service, pass a custom HTTPS base URL as the custom_auth_url parameter.

Member Data Documentation

◆ app_id

std::string ditto::OnlineWithAuthenticationIdentity::app_id

The app ID associated with the identity.

◆ custom_auth_url

std::string ditto::OnlineWithAuthenticationIdentity::custom_auth_url

The URL of a custom authentication service that will be used instead of Ditto Cloud, if provided. Otherwise this will be an empty string.

◆ enable_ditto_cloud_sync

bool ditto::OnlineWithAuthenticationIdentity::enable_ditto_cloud_sync

Whether or not sync with Ditto cloud is enabled.