Ditto 5.0.0
Loading...
Searching...
No Matches
DittoSDK.Auth Namespace Reference

Classes

struct  DittoAuthenticationProvider
 Represents a string-based authentication provider identifier used for login with Ditto. More...
class  DittoAuthenticationRequestEventArgs
 Data passed to the Ditto.DittoIdentityProviderAuthenticationRequest event handler when a peer wishes to use the current device as an authentication server. More...
struct  DittoAuthenticationStatus
 Provides info about the authentication status. More...
class  DittoAuthenticationSuccess
 Defines the properties and permissions of a user who has authenticated successfully and will be able to participate in the Ditto mesh. More...
class  DittoAuthenticator
 Provides access to authentication information and methods for logging on to Ditto Server. Relevant when using DittoConfigConnect.Server config. More...

Functions

delegate Task DittoAuthenticationExpirationHandler (Ditto ditto, TimeSpan timeUntilExpiration)
 A delegate that handles authentication expiration events for a Ditto instance.

Function Documentation

◆ DittoAuthenticationExpirationHandler()

delegate Task DittoSDK.Auth.DittoAuthenticationExpirationHandler ( Ditto ditto,
TimeSpan timeUntilExpiration )

A delegate that handles authentication expiration events for a Ditto instance.

This handler is invoked when the authentication for a Ditto instance has or is about to expire, or if authentication has not yet occurred. It provides access to the relevant Ditto instance and the amount of time remaining until authentication expires.

You can use this to login or perform other necessary actions before authentication expires. This delegate is expected to return a Task, allowing for asynchronous operations.

Important: When using server connections (DittoConfigConnect.Server(Uri)), you must assign this handler via DittoAuthenticator.ExpirationHandler. Otherwise, calling DittoSync.Start() will throw a ExpirationHandlerMissingException

Parameters
dittoThe Ditto instance whose authentication is expiring.
timeUntilExpirationThe time interval, as a TimeSpan, until authentication expires.
Returns
A Task representing an asynchronous operation.