Use this class to authorize with an existing KeepSolid account or create a new one. After initializing an instance of this class with an instance of VPNUTransport and performing authorization, be sure to pass the same instance of VPNUTransport to other classes which depend on it. Otherwise you will not be able to use all features of SDK.
Extends: NSObject
Declared in: VPNUAuthorizer.h
+ (instancetype)authorizerWithTransport:(VPNUTransport *)transport;
An initialized authorizer object or nil if the object couldn't be created.
This method is a convenience constructor.
- (VPNUAccountUserInfo *)authorizeWithLogin:(NSString *)login andPassword:(NSString *)password error:(NSError **)error;
An object which represents the user's account information if no error has occured, nil otherwise.
This method tries to authorize a user with specified login and password synchronously and waits for the response. It blocks a calling thread. This method shouldn't be called from main thread.
- (instancetype)initWithTransport:(VPNUTransport *)transport NS_DESIGNATED_INITIALIZER;
An initialized authorizer object or nil if the object couldn't be created.
- (VPNUAccountUserInfo *)registerWithLogin:(NSString *)login andPassword:(NSString *)password marketingEmails:(BOOL)doNotReceiveMarketingEmails error:(NSError **)error;
An object which represents the user's account information if no error has occured, nil otherwise.
This method tries to register a new user with specified login and password synchronously and waits for the response. It blocks a calling thread. If registration is successful, it automatically logs in the newly created user. This method shouldn't be called from main thread.
- (BOOL)resendConfirmationEmailForLogin:(NSString *)login error:(NSError **)error;
YES if no error has occured, NO otherwise.
This method notifies the server that it needs to resend the confirmation letter to email associated with specified login. This method shouldn't be called from main thread.
- (BOOL)signOutWithError:(NSError **)error;
YES if no error has occured, NO otherwise.
This method clears current session, signals server about sign-out event and waits for the response. It blocks a calling thread. This method shouldn't be called from main thread.