Ditto 4.4.5
|
The various identity configurations that you can use when initializing a Ditto instance. More...
#include <Identity.hpp>
Static Public Member Functions | |
static std::shared_ptr< OfflinePlaygroundIdentity > | OfflinePlayground (std::string app_id="", uint64_t site_id=0) |
Construct a new OfflinePlaygroundIdentity. | |
static std::shared_ptr< OnlineWithAuthenticationIdentity > | OnlineWithAuthentication (std::string app_id, std::shared_ptr< AuthenticationCallback > callback, bool enable_ditto_cloud_sync=true, std::string custom_auth_url="") |
Construct a new OnlineWithAuthenticationIdentity. | |
static std::shared_ptr< OnlinePlaygroundIdentity > | OnlinePlayground (std::string app_id, std::string token, bool enable_ditto_cloud_sync=true) |
Construct a new OnlinePlaygroundIdentity. | |
static std::shared_ptr< SharedKeyIdentity > | SharedKey (std::string app_id, std::string shared_key, uint64_t site_id=0) |
Construct a new SharedKeyIdentity. | |
static std::shared_ptr< ManualIdentity > | Manual (std::string certificate_config) |
Construct a new ManualIdentity. | |
Public Attributes | |
IdentityType | type |
The various identity configurations that you can use when initializing a Ditto instance.
The different supported identities and when they should be used are as follows:
|
static |
Construct a new ManualIdentity.
[in] | config | a base64-encoded string representation of a certificate bundle. |
|
static |
Construct a new OfflinePlaygroundIdentity.
[in] | app_id | the ID of the app. If you are developing multiple apps, use distinct names to ensure they do not attempt to connect and sync with each other. |
[in] | site_id | the site ID for the device. Use this to identity different users or devices. Site IDs are persisted between sessions when using a development identity. Site IDs should be unique and not reused by different users or devices. |
|
static |
Construct a new OnlinePlaygroundIdentity.
[in] | appID | a UUID identifying this app registration on the Ditto portal, which can be found at https://portal.ditto.live. |
[in] | token | a shared token used to set up the OnlinePlayground session. This token is provided by the Ditto portal when setting up the application. |
[in] | enable_ditto_cloud_sync | if true, auto-configure sync with Ditto Cloud. |
|
static |
Construct a new OnlineWithAuthenticationIdentity.
[in] | appID | a UUID identifying this app registration on the Ditto portal, which can be found at https://portal.ditto.live. |
[in] | callback | a handler for when Ditto requires (re)authentication. |
[in] | enable_ditto_cloud_sync | if true, auto-configure sync with Ditto Cloud. |
[in] | custom_auth_url | if specified, use a custom authentication service instead of Ditto Cloud. |
|
static |
Construct a new SharedKeyIdentity.
[in] | app_id | the ID of the app, specified in domain format, e.g. "app.ditto.live". All peers must use the same app ID to communicate. |
[in] | shared_key | a base64-encoded DER private key. Refer to Ditto documentation for details about generating shared keys. |
[in] | site_id | the site ID for the device. For shared key mode, this can be left unspecified to choose a random number. |