DITAuthenticator
@interface DITAuthenticator : NSObject
Provides access to authentication information and methods for logging on to
Ditto Cloud. Relevant when using an OnlineWithAuthentication or an Online
identity.
-
Log in to Ditto with a third-party token.
Declaration
Objective-C
- (void)loginWithToken:(nonnull NSString *)token provider:(nullable NSString *)provider completion:(nonnull void (^)(NSError *_Nullable))completion;Parameters
tokenthe authentication token required to log in.
providerthe name of the authentication provider.
completiona block that will get called when the login attempt has completed.
-
Log in to Ditto with a username and password.
Declaration
Objective-C
- (void)loginWithUsername:(nonnull NSString *)username password:(nonnull NSString *)password provider:(nullable NSString *)provider completion:(nonnull void (^)(NSError *_Nullable))completion;Parameters
usernamethe username component of the credentials used for log in.
passwordthe password component of the credentials used for log in.
providerthe name of the authentication provider.
completiona block that will get called when the login attempt has completed.
-
Query whether Ditto has a valid authentication token.
This will only be
YESwhen using anOnlineWithAuthenticationor anOnlineidentity, after a successful login. If the authentication token is allowed to expire then it will returnNOinstead.Declaration
Objective-C
- (BOOL)isAuthenticated; -
Return the currently logged-in user ID.
This will return
nilif there is no valid authentication orOnlineWithAuthentication/Onlinemode is not being used.Declaration
Objective-C
- (NSString *_Nullable)userID;
DITAuthenticator Class Reference