-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOAuthEngine.h
63 lines (45 loc) · 1.57 KB
/
OAuthEngine.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// OAuthEngine.h
// OAuthOniPhone
//
// Created by xu xhan on 5/20/10.
// Copyright 2010 xu han. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "OAuthConsumer.h"
// OAuth 1.0a add "oauth_verifier" at the last step of auth
@protocol OAuthEngineDelegate <NSObject>
@optional
- (void)OAuthEngineFailed:(NSData*)data;
- (void)OAuthEngineRequestTokenSuccess;
- (void)OAuthEngineAccessTokenSuccess;
@end
@interface OAuthEngine : NSObject {
NSString *_consumerSecret;
NSString *_consumerKey;
NSURL *_requestTokenURL;
NSURL *_accessTokenURL;
NSURL *_authorizeURL;
id<OAuthEngineDelegate> _delegate;
OAConsumer *_consumer;
OAToken *_requestToken;
OAToken *_accessToken;
}
@property (nonatomic, retain) OAToken *accessToken;
@property (nonatomic, retain) OAToken *requestToken;
@property (nonatomic, retain) OAConsumer *consumer;
@property (nonatomic, assign) id<OAuthEngineDelegate> delegate;
@property (nonatomic, retain) NSURL *authorizeURL;
@property (nonatomic, retain) NSURL *accessTokenURL;
@property (nonatomic, retain) NSURL *requestTokenURL;
@property (nonatomic, copy) NSString *consumerKey;
@property (nonatomic, copy) NSString *consumerSecret;
- (id)initWithConsumerKey:(NSString*)key Secret:(NSString*)secret RequestTokenURL:(NSString*)requestURLstr AuthorizeURL:(NSString*)authorizeURLstr AccessTokenURL:(NSString*)accessURLstr;
// 1.0
- (void) requestAccessToken;
// 1.0a
- (void) requestAccessTokenWithVerifier:(NSString*)verifier;
- (void) requestRequestToken;
- (void) requestAuthorizeAction;
- (NSURLRequest*)authorizeURLRequest;
@end