Files
khanhduytran0 28df9fcc68 Feat[auth]: move tokens to keychain
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.
2024-04-04 19:12:32 +07:00

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