|
Ditto 5.0.0
|
Provides access to authentication information and methods for logging on to Ditto Server. Relevant when using DittoConfigConnect.Server config. More...
Public Member Functions | |
| Task< string > | LoginAsync (string token, string provider) |
| Logs in to Ditto using a third-party authentication token. | |
| Task< string > | LoginAsync (string token, DittoAuthenticationProvider provider) |
| Logs in to Ditto using a third-party authentication token. | |
| IDisposable | ObserveStatus (Action< DittoAuthenticationStatus > callback) |
| Registers a callback that is called whenever the authentication status changes. | |
| void | Logout (Action< Ditto > cleanupAction=null) |
| Log out of Ditto. | |
Properties | |
| DittoAuthenticationExpirationHandler | ExpirationHandler [get, set] |
| Gets or sets the handler that will be invoked when authentication for this Ditto instance is about to expire. | |
| DittoAuthenticationStatus | Status [get] |
| Gets the current authentication status. | |
Provides access to authentication information and methods for logging on to Ditto Server. Relevant when using DittoConfigConnect.Server config.
|
inline |
Logs in to Ditto using a third-party authentication token.
If authentication succeeds, this method returns the clientInfoJson string. If authentication fails, it throws a DittoAuthenticationException. The exception will contain any JSON returned from the authentication webhook under the clientInfo key, if available, via its ClientInfoJson property.
| token | The authentication token required to log in. |
| provider | The name of the authentication provider. |
| DittoAuthenticationException | Thrown when authentication fails. |
|
inline |
Logs in to Ditto using a third-party authentication token.
If authentication succeeds, this method returns the clientInfoJson string. If authentication fails, it throws a DittoAuthenticationException. The exception will contain any JSON returned from the authentication webhook under the clientInfo key, if available, via its ClientInfoJson property.
| token | The authentication token required to log in. |
| provider | The name of the authentication provider. |
| DittoAuthenticationException | Thrown when authentication fails. |
|
inline |
Log out of Ditto.
This will stop sync, shut down all replication sessions, and remove any cached authentication credentials. Note that this does not remove any data from the store. If you wish to delete data from the store then use the optional cleanupAction argument to perform any required cleanup.
| cleanupAction | An optional action that will be called with the relevant Ditto instance as the sole argument that allows you to perform any required cleanup of the store as part of the logout process. |
|
inline |
Registers a callback that is called whenever the authentication status changes.
| callback | An action reference to the caller's callback. |
IDisposable that you can use to stop this observation.
|
getset |
Gets or sets the handler that will be invoked when authentication for this Ditto instance is about to expire.
Assign this property to be notified shortly before authentication expires, allowing you to log in or perform other necessary actions.
Important: If the Ditto instance was initialized with DittoConfigConnect.Server(Uri), this property must be set, and the assigned handler must perform proper authentication when triggered.
If not set, calling DittoSync.Start() will throw an ExpirationHandlerMissingException