Previously, tokens were saved in json under plain text, making it insecure. Now, they are stored in iOS's keychian with the hope of making it more secure.
29 lines
649 B
Objective-C
29 lines
649 B
Objective-C
#import "Foundation/Foundation.h"
|
|
|
|
typedef void(^Callback)(id status, BOOL success);
|
|
|
|
@interface BaseAuthenticator : NSObject
|
|
|
|
@property(class) BaseAuthenticator *current;
|
|
|
|
@property NSMutableDictionary *authData;
|
|
|
|
+ (id)loadSavedName:(NSString *)name;
|
|
+ (NSDictionary *)tokenDataOfProfile:(NSString *)profile;
|
|
|
|
- (id)initWithInput:(NSString *)string;
|
|
- (void)loginWithCallback:(Callback)callback;
|
|
- (void)refreshTokenWithCallback:(Callback)callback;
|
|
- (BOOL)saveChanges;
|
|
|
|
@end
|
|
|
|
@interface LocalAuthenticator : BaseAuthenticator
|
|
@end
|
|
|
|
@interface MicrosoftAuthenticator : BaseAuthenticator
|
|
|
|
+ (void)clearTokenDataOfProfile:(NSString *)profile;
|
|
|
|
@end
|