nsurlcredential

NSURLConnection does not use the default credential

人走茶凉 提交于 2019-12-03 17:30:28
I'm trying to connect to http://cmis.demo.nuxeo.org/nuxeo/atom/cmis/ with NSURLConnection . This demo web service is documented to require authentication (login: Administrator / password: Administrator). Edit : This web service now sends an authentication challenge, it was not at the time the question was asked. This web service does not send an authentication challenge, so I can't use the connection:didReceiveAuthenticationChallenge: delegate method. Instead I set a default NSURLCredential in the shared credential storage. Unfortunately, this default credential is not used by NSURLConnection

NSURLCredential and NSURLConnection

冷暖自知 提交于 2019-12-03 17:20:42
I have been trying to search for a way to unset the credentials once you set a NSURLCredential with a NSURLConnection that is using NSURLCredentialPersistenceForSession, but I couldn't find a working solution. Removing the NSURLCredential from the NSURLCredentialStorage only removes it from the storage and not from the NSURLConnection cache. I tried turning cache off and it still keeps it. I need it to be NSURLCredentialPersistenceForSession as I don't want it to be uploading the large data then getting back the you need to authenticate message then authenticating with NSURLConnection and then

AFNetworking with NSURLCredential

被刻印的时光 ゝ 提交于 2019-12-03 15:33:46
问题 I have 3 methods, UserLogin, Login and LogoutButtonPressed: UserLogin: I am using AFNetworking to connect to a Windows Authenticated URL using NSURLCredential: -(void)UserLogin:(NSString *)user andPassWordExists:(NSString *)password completionHandler:(void (^)(NSArray *resultsObject, NSError *error))completionHandler { NSURL *url = [NSURL URLWithString:kIP]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc]

AFNetworking with NSURLCredential

谁说胖子不能爱 提交于 2019-12-03 05:01:38
I have 3 methods, UserLogin, Login and LogoutButtonPressed: UserLogin: I am using AFNetworking to connect to a Windows Authenticated URL using NSURLCredential: -(void)UserLogin:(NSString *)user andPassWordExists:(NSString *)password completionHandler:(void (^)(NSArray *resultsObject, NSError *error))completionHandler { NSURL *url = [NSURL URLWithString:kIP]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; NSURLCredential *credential = [NSURLCredential credentialWithUser:user password

NSURLCredentialStorage and client certificate authentication

我们两清 提交于 2019-11-30 10:36:05
From what I see in the documentation of MPMoviewPlayerController, NSURLCredentialStorage can be set up as an alternative of NSURLConnection authentication challenges (this is useful for higher level classes that load resources from URLs but abstract the NSURLConnection away and don't provide a delegate for handling authentication challenges). This seems similar to installing a certificate in the browser and having it auto select the required certificate when a certain address demands it. To test this out I have set up my own certificate authority, server certificate and client certificate (a

Basic Authentication with Alamofire

拥有回忆 提交于 2019-11-30 06:38:32
Experiencing an issue when authenticating with Basic Auth. I am using a standard enum that conforms to URLRequestConvertible protocol to construct my requests. The issue is that when I manually set the authorization headers in the enum like so: let user = *** let password = *** let credentialData = "\(user):\(password)".dataUsingEncoding(NSUTF8StringEncoding)! let base64Credentials = credentialData.base64EncodedStringWithOptions([]) mutableURLRequest.setValue("Basic \(base64Credentials)", forHTTPHeaderField: "Authorization") I always get a 401 unauthorized response. However if I set the

Basic Authentication with Alamofire

风流意气都作罢 提交于 2019-11-29 06:12:27
问题 Experiencing an issue when authenticating with Basic Auth. I am using a standard enum that conforms to URLRequestConvertible protocol to construct my requests. The issue is that when I manually set the authorization headers in the enum like so: let user = *** let password = *** let credentialData = "\(user):\(password)".dataUsingEncoding(NSUTF8StringEncoding)! let base64Credentials = credentialData.base64EncodedStringWithOptions([]) mutableURLRequest.setValue("Basic \(base64Credentials)",