Skip to content

Commit

Permalink
new release time
Browse files Browse the repository at this point in the history
  • Loading branch information
zeeshanlakhani committed Nov 22, 2013
1 parent 079c694 commit d1d567c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions AFXAuthClient/AFXAuthClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@
return AFEncodeBase64WithData(signatureData);
}

static inline NSString * PlainTextSignature(NSString *consumerSecret, NSString *tokenSecret) {
NSString *secret = tokenSecret ? tokenSecret : @"";
NSString *secretString = [NSString stringWithFormat:@"%@&%@", consumerSecret, secret];
return secretString;
}

#pragma mark -

@interface AFXAuthClient ()
Expand Down Expand Up @@ -224,11 +230,11 @@ -(void)authorizeUsingXAuthWithAccessTokenPath:(NSString *)accessTokenPath
}

- (NSMutableDictionary *)authorizationHeaderWithRequest:(NSURLRequest *)request parameters:(NSDictionary *)parameters {
NSMutableDictionary *authorizationHeader = [[NSMutableDictionary alloc] initWithDictionary:@{@"oauth_nonce": _nonce,
@"oauth_signature_method": @"HMAC-SHA1",
NSMutableDictionary *authorizationHeader = [[NSMutableDictionary alloc] initWithDictionary:@{@"oauth_nonce": [NSString stringWithFormat:@"%@%@", _nonce, request],
@"oauth_signature_method": @"PLAINTEXT",
@"oauth_timestamp": _timestamp,
@"oauth_consumer_key": self.consumerKey,
@"oauth_signature": AFHMACSHA1Signature([self baseStringWithRequest:request parameters:parameters], _consumerSecret, _token.secret),
@"oauth_signature": PlainTextSignature(_consumerSecret, _token.secret),
@"oauth_version": @"1.0"}];

if (parameters && [[parameters allKeys] containsObject:@"x_auth_mode"]) {
Expand Down

0 comments on commit d1d567c

Please sign in to comment.