diff --git a/AFNetworking/AFURLConnectionOperation.m b/AFNetworking/AFURLConnectionOperation.m index 17c98c9..fa4b488 100644 --- a/AFNetworking/AFURLConnectionOperation.m +++ b/AFNetworking/AFURLConnectionOperation.m @@ -550,8 +550,8 @@ didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge if ([challenge previousFailureCount] == 0) { NSURLCredential *credential = nil; - NSString *username = (__bridge_transfer NSString *)CFURLCopyUserName((__bridge CFURLRef)[self.request URL]); - NSString *password = (__bridge_transfer NSString *)CFURLCopyPassword((__bridge CFURLRef)[self.request URL]); + NSString *username = [[self.request URL] user]; + NSString *password = [[self.request URL] password]; if (username && password) { credential = [NSURLCredential credentialWithUser:username password:password persistence:NSURLCredentialPersistenceNone];