diff --git a/AFNetworking/AFHTTPRequestOperationManager.h b/AFNetworking/AFHTTPRequestOperationManager.h index 7652a28..cb6fe2e 100644 --- a/AFNetworking/AFHTTPRequestOperationManager.h +++ b/AFNetworking/AFHTTPRequestOperationManager.h @@ -108,6 +108,24 @@ */ @property (nonatomic, strong) NSOperationQueue *operationQueue; +///------------------------------- +/// @name Managing URL Credentials +///------------------------------- + +/** + Whether request operations should consult the credential storage for authenticating the connection. `YES` by default. + + @see AFURLConnectionOperation -shouldUseCredentialStorage + */ +@property (nonatomic, assign) BOOL shouldUseCredentialStorage; + +/** + The credential used by request operations for authentication challenges. + + @see AFURLConnectionOperation -credential + */ +@property (nonatomic, strong) NSURLCredential *credential; + ///------------------------------- /// @name Managing Security Policy ///------------------------------- diff --git a/AFNetworking/AFHTTPRequestOperationManager.m b/AFNetworking/AFHTTPRequestOperationManager.m index 3a30cc2..06775bc 100644 --- a/AFNetworking/AFHTTPRequestOperationManager.m +++ b/AFNetworking/AFHTTPRequestOperationManager.m @@ -101,6 +101,8 @@ { AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; operation.responseSerializer = self.responseSerializer; + operation.shouldUseCredentialStorage = self.shouldUseCredentialStorage; + operation.credential = self.credential; operation.securityPolicy = self.securityPolicy; [operation setCompletionBlockWithSuccess:success failure:failure];