Skip to content
Browse files

Merge pull request #18 from shir/patch-1

Allows to use oAuth without token (using only with consumer key)
  • Loading branch information...
2 parents 27b32cd + f5e16e5 commit e6c4ee63b1984c5020d01d991918ecaadb426bb0 @mattt mattt committed Mar 5, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 AFOAuth1Client/AFOAuth1Client.m
View
8 AFOAuth1Client/AFOAuth1Client.m
@@ -331,11 +331,13 @@ - (NSMutableURLRequest *)requestWithMethod:(NSString *)method
{
NSMutableDictionary *mutableParameters = parameters ? [parameters mutableCopy] : [NSMutableDictionary dictionary];
- if (self.accessToken) {
+ if (self.key && self.secret) {
[mutableParameters addEntriesFromDictionary:[self OAuthParameters]];
- [mutableParameters setValue:self.accessToken.key forKey:@"oauth_token"];
+ if (self.accessToken) {
+ [mutableParameters setValue:self.accessToken.key forKey:@"oauth_token"];
+ }
}
-
+
[mutableParameters setValue:[self OAuthSignatureForMethod:method path:path parameters:mutableParameters token:self.accessToken] forKey:@"oauth_signature"];
NSMutableURLRequest *request = [super requestWithMethod:method path:path parameters:mutableParameters];

0 comments on commit e6c4ee6

Please sign in to comment.
Something went wrong with that request. Please try again.