Skip to content

Commit

Permalink
Added credential handling method for Tiger.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgemmell committed Sep 25, 2008
1 parent 3eb0a81 commit da4d0bb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions MGTwitterEngine.m
Expand Up @@ -600,6 +600,18 @@ - (void)parsingFailedForRequest:(NSString *)requestIdentifier
#pragma mark NSURLConnection delegate methods


- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
{
if ([challenge previousFailureCount] == 0 && ![challenge proposedCredential]) {
NSURLCredential *credential = [NSURLCredential credentialWithUser:_username password:_password
persistence:NSURLCredentialPersistenceForSession];
[[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
} else {
[[challenge sender] continueWithoutCredentialForAuthenticationChallenge:challenge];
}
}


- (void)connection:(MGTwitterHTTPURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
// This method is called when the server has determined that it has enough information to create the NSURLResponse.
Expand Down

0 comments on commit da4d0bb

Please sign in to comment.