ReadonlyloginReturns true if authentication is available and the login methods can be
used, otherwise returns false. Currently, authentication is only
available if Ditto was initialized with an identity of type
'onlineWithAuthentication'.
The handler that will be called when authentication for this Ditto instance is about to expire.
This API is in preview and provides a replacement for the phased out AuthenticationHandler interface.
Important: If the Ditto instance is configured with a DittoConfigConnectServer this property must be set and the handler must properly authenticate when called.
Returns the current authentication status.
StaticDEVELOPMENT_The built-in development authentication provider to be used together with development authentication tokens.
This API is in preview as part of the new configuration APIs that replace the legacy Identity-based initialization.
Authenticator.login() for more information
about the provider parameter.
Log in to Ditto with a third-party token.
Returns a promise that resolves to a LoginResult object. When the login
attempt is successful, the error property of the response will be null,
otherwise it will contain a DittoError object with details about
the error.
If the authentication service provides additional client info, it will be
returned in the clientInfo property of the response, whether the login
attempt was successful or not.
The authentication token required to log in.
The name of the authentication provider. Use Authenticator.DEVELOPMENT_PROVIDER with development tokens.
A promise that resolves to a LoginResult object.
DittoError authentication/failed-to-authenticate if the
Ditto instance is closed.
Log in to Ditto with a third-party token. Throws if authentication is not available, which can be checked with loginSupported.
the authentication token required to log in.
the name of the authentication provider.
Use login instead, which provides access to client info provided by the authentication service.
Log in to Ditto with a username and password. Throws if authentication is not available, which can be checked with loginSupported.
the username component of the credentials used for log in.
the password component of the credentials used for log in.
the name of the authentication provider.
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 cleanupFn parameter to perform any required cleanup.
Sets the handler that will be called when authentication for this Ditto instance is about to expire.
This API is in preview and provides a replacement for the phased out AuthenticationHandler interface.
Assign a handler function to be notified before authentication expires, allowing you to login or perform other necessary actions.
Log in to a remote authentication service, using an
OnlineWithAuthenticationor anOnlineidentity.