1#ifndef _DITTO_IDENTITY_
2#define _DITTO_IDENTITY_
4#include "AuthenticationCallback.hpp"
15class OfflinePlaygroundIdentity;
16class OnlineWithAuthenticationIdentity;
17class OnlinePlaygroundIdentity;
18class SharedKeyIdentity;
24enum class IdentityType {
26 ONLINE_WITH_AUTHENTICATION,
79 static std::shared_ptr<OfflinePlaygroundIdentity>
81 std::string persistence_dir =
"");
96 static std::shared_ptr<OnlineWithAuthenticationIdentity>
98 std::shared_ptr<AuthenticationCallback> callback,
99 bool enable_ditto_cloud_sync =
true,
100 std::string custom_auth_url =
"",
101 std::string persistence_dir =
"");
119 static std::shared_ptr<OnlinePlaygroundIdentity>
121 bool enable_ditto_cloud_sync =
true,
122 std::string persistence_dir =
"");
136 static std::shared_ptr<SharedKeyIdentity>
137 SharedKey(std::string app_id, std::string shared_key, uint64_t site_id = 0,
138 std::string persistence_dir =
"");
146 static std::shared_ptr<ManualIdentity>
Manual(std::string certificate_config);
149 virtual std::string get_app_id()
const;
150 virtual std::shared_ptr<Authenticator> get_authenticator()
const;
151 virtual bool get_enable_ditto_cloud_sync()
const;
152 virtual bool requires_offline_license_token()
const;
153 std::shared_ptr<CAuthClient_t> auth_client;
177 std::string persistence_dir);
179 std::string get_app_id()
const;
180 bool requires_offline_license_token()
const;
225 std::string
app_id, std::shared_ptr<AuthenticationCallback> callback,
227 std::string persistence_dir);
229 std::string get_app_id()
const;
230 bool get_enable_ditto_cloud_sync()
const;
231 std::shared_ptr<Authenticator> get_authenticator()
const;
232 std::shared_ptr<Authenticator> authenticator;
233 std::shared_ptr<LoginProvider> login_provider;
234 bool requires_offline_license_token()
const;
265 std::string persistence_dir);
267 std::string get_app_id()
const;
268 std::string get_token()
const;
269 bool get_enable_ditto_cloud_sync()
const;
270 bool requires_offline_license_token()
const;
271 std::shared_ptr<Authenticator> get_authenticator()
const;
272 std::shared_ptr<Authenticator> authenticator;
302 std::string persistence_dir);
304 std::string get_app_id()
const;
305 bool requires_offline_license_token()
const;
324 bool requires_offline_license_token()
const;
The entrypoint to the Ditto SDK.
Definition: Ditto.hpp:22
The various identity configurations that you can use when initializing a Ditto instance.
Definition: Identity.hpp:53
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="", std::string persistence_dir="")
Construct a new OnlineWithAuthenticationIdentity.
Definition: Identity.cpp:34
static std::shared_ptr< ManualIdentity > Manual(std::string certificate_config)
Construct a new ManualIdentity.
Definition: Identity.cpp:60
static std::shared_ptr< OnlinePlaygroundIdentity > OnlinePlayground(std::string app_id, std::string token, bool enable_ditto_cloud_sync=true, std::string persistence_dir="")
Construct a new OnlinePlaygroundIdentity.
Definition: Identity.cpp:45
static std::shared_ptr< SharedKeyIdentity > SharedKey(std::string app_id, std::string shared_key, uint64_t site_id=0, std::string persistence_dir="")
Construct a new SharedKeyIdentity.
Definition: Identity.cpp:53
static std::shared_ptr< OfflinePlaygroundIdentity > OfflinePlayground(std::string app_id="", uint64_t site_id=0, std::string persistence_dir="")
Construct a new OfflinePlaygroundIdentity.
Definition: Identity.cpp:27
A manually-provided certificate identity. This accepts a base64-encoded bundle.
Definition: Identity.hpp:312
std::string certificate_config
Definition: Identity.hpp:320
Develop peer-to-peer apps with no cloud connection. This mode offers no security and must only be use...
Definition: Identity.hpp:161
std::string app_id
Definition: Identity.hpp:168
uint64_t site_id
Definition: Identity.hpp:173
Test a Ditto Cloud app with weak shared token authentication ("Playground mode"). This is not secure ...
Definition: Identity.hpp:242
std::string token
Definition: Identity.hpp:255
std::string app_id
Definition: Identity.hpp:249
bool enable_ditto_cloud_sync
Definition: Identity.hpp:260
Run Ditto in secure production mode, logging on to Ditto Cloud or on on-premises authentication serve...
Definition: Identity.hpp:203
std::string app_id
Definition: Identity.hpp:210
std::string custom_auth_url
Definition: Identity.hpp:221
bool enable_ditto_cloud_sync
Definition: Identity.hpp:215
A mode where any device is trusted provided they know the secret key. This is a simplistic authentica...
Definition: Identity.hpp:281
std::string shared_key
Definition: Identity.hpp:293
uint64_t site_id
Definition: Identity.hpp:298
std::string app_id
Definition: Identity.hpp:288