DittoAuthenticator
Provides access to authentication information and methods for logging on to
Ditto Cloud. Relevant when using an onlineWithAuthentication
or an
online
identity.
-
Returns the current authentication status.
-
Log in to Ditto with a third-party token.
@param token the authentication token required to log in. @param provider the name of the authentication provider. @param completion a closure that will get called when the login attempt has completed.
-
Log in to Ditto with a username and password.
@param username the username component of the credentials used for log in. @param password the password component of the credentials used for log in. @param provider the name of the authentication provider. @param completion a closure that will get called when the login attempt has completed.
-
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
cleanup
closure to perform any required cleanup.@param cleanup an optional closure 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. -
Registers a block that will be called whenever authentication
status
changes. Returns aDittoObserver
that needs to be retained as long as you want to receive the updates.