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.
Available in Mac OS X v10.7. Available in iOS v7.0.
- (VPNUAccountUserInfo *)authorizeWithLogin:(NSString *)login andPassword:(NSString *)password error:(NSError **)error;
nil
.nil
.nil
.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.
Available in Mac OS X v10.7. Available in iOS v7.0.
- (instancetype)initWithTransport:(VPNUTransport *)transport NS_DESIGNATED_INITIALIZER;
An initialized authorizer object or nil if the object couldn't be created.
Available in Mac OS X v10.7. Available in iOS v7.0.
- (VPNUAccountUserInfo *)registerWithLogin:(NSString *)login andPassword:(NSString *)password error:(NSError **)error;
nil
.nil
.nil
.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.
Available in Mac OS X v10.7. Available in iOS v7.0.
- (BOOL)resendConfirmationEmailForLogin:(NSString *)login error:(NSError **)error;
nil
.nil
.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.
Available in Mac OS X v10.7. Available in iOS v7.0.
- (BOOL)signOutWithError:(NSError **)error;
nil
.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.
Available in Mac OS X v10.7. Available in iOS v7.0.