Skip to content

Commit

Permalink
Made SDFacebookTaskManager a little more friendly by creating a sort …
Browse files Browse the repository at this point in the history
…of interface between basic user/password authentication and FB's OAuth crap, via 2 methods.
  • Loading branch information
Steven Degutis committed Jun 25, 2009
1 parent b5004b1 commit 766638c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/SDFacebookTaskManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@
@property (copy) NSString *sessionKey;
@property (copy) NSString *sessionUID;

- (void) useSessionIdentifier:(NSString*)sessionIdentifier sessionCredentials:(NSString*)sessionCredentials;

- (NSString*) sessionCredentials;

@end
13 changes: 13 additions & 0 deletions Source/SDFacebookTaskManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ @implementation SDFacebookTaskManager
@synthesize sessionKey;
@synthesize sessionUID;

#define SDSessionCredentialsDelimiter @"~"

- (void) dealloc {
[apiKey release], apiKey = nil;
[apiSecret release], apiSecret = nil;
Expand All @@ -34,4 +36,15 @@ - (void) dealloc {
[super dealloc];
}

- (void) useSessionIdentifier:(NSString*)sessionIdentifier sessionCredentials:(NSString*)sessionCredentials {
NSArray *parts = [sessionCredentials componentsSeparatedByString:SDSessionCredentialsDelimiter];
self.sessionUID = sessionIdentifier;
self.sessionSecret = [parts objectAtIndex:0];
self.sessionKey = [parts objectAtIndex:1];
}

- (NSString*) sessionCredentials {
return [NSString stringWithFormat:@"%@%@%@", self.sessionSecret, SDSessionCredentialsDelimiter, self.sessionKey];
}

@end

0 comments on commit 766638c

Please sign in to comment.