-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRCOAuth2Engine.h
43 lines (34 loc) · 1.11 KB
/
RCOAuth2Engine.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// RCOAuth2Engine.h
//
// Created by Ruiwen Chua on 5/16/12.
// Copyright (c) 2012 Ruiwen Chua. MIT Licensed.
//
#import "MKNetworkEngine.h"
typedef void (^RCOAuth2CompletionBlock)(NSError *error);
@interface RCOAuth2Engine : MKNetworkEngine
{
@private
NSMutableDictionary *_tokens;
NSString *_hostname;
NSString *_authPath;
NSString *_tokenPath;
NSString *_redirect;
}
@property (copy) RCOAuth2CompletionBlock oAuthCompletionBlock;
@property (readonly) NSString *clientId;
@property (readonly) NSString *clientSecret;
- (RCOAuth2Engine *)initWithHostname:(NSString *)hostname
customHeaderFields:(NSDictionary *)headers
clientId:(NSString *)clientId
clientSecret:(NSString *)clientSecret
authPath:(NSString *)authPath
tokenPath:(NSString *)tokenPath
redirectURI:(NSString *)redirect;
- (BOOL)isAuthenticated;
- (void)authenticateWithCompletionBlock:(RCOAuth2CompletionBlock)completionBlock;
- (void)completeOAuthWithCode:(NSString *)code;
- (void)parseOAuth2Query:(NSURL *)url;
- (void)resetAuth;
- (void)enqueueSignedOperation:(MKNetworkOperation *)request;
@end