Permalink
Browse files

Added extended HTTP parsing to OAToken for subclass support

  • Loading branch information...
1 parent b4776fa commit 4afe9f6716b7c9e1d3c36d25703a6b674214303b @stevestreza committed Jan 1, 2010
Showing with 12 additions and 0 deletions.
  1. +1 −0 OAHMAC_SHA1SignatureProvider.m
  2. +3 −0 OAToken.h
  3. +8 −0 OAToken.m
@@ -39,6 +39,7 @@ - (NSString *)name {
- (NSString *)signClearText:(NSString *)text withSecret:(NSString *)secret {
NSData *secretData = [secret dataUsingEncoding:NSUTF8StringEncoding];
NSData *clearTextData = [text dataUsingEncoding:NSUTF8StringEncoding];
+
unsigned char result[20];
// hmac_sha1((unsigned char *)[clearTextData bytes], [clearTextData length], (unsigned char *)[secretData bytes], [secretData length], result);
CCHmac(kCCHmacAlgSHA1, [secretData bytes], [secretData length], [clearTextData bytes], [clearTextData length], result);
View
@@ -69,4 +69,7 @@
+ (void)removeFromUserDefaultsWithServiceProviderName:(const NSString *)provider prefix:(const NSString *)prefix;
+//http parsing
+-(BOOL)parseHTTPKey:(NSString *)paramKey value:(id)body;
+
@end
View
@@ -96,11 +96,19 @@ - (id)initWithHTTPResponseBody:(const NSString *)body {
if ([lowerCase isEqualToString:@"true"] || [lowerCase isEqualToString:@"t"]) {
renew = YES;
}
+ } else{
+ NSString *httpKey = [elements objectAtIndex:0];
+ NSString *httpValue = [elements objectAtIndex:1];
+ [self parseHTTPKey:httpKey value:httpValue];
}
}
return [self initWithKey:aKey secret:aSecret session:aSession duration:aDuration
attributes:attrs created:creationDate renewable:renew];
+}
+
+-(void)parseHTTPKey:(NSString *)httpKey value:(id)httpValue{
+
}
- (id)initWithUserDefaultsUsingServiceProviderName:(const NSString *)provider prefix:(const NSString *)prefix {

0 comments on commit 4afe9f6

Please sign in to comment.