Questions tagged [nsurlcredentialstorage]

13 questions
3
votes
1 answer

URLSession Credentials Caching Allowing Authentication with Incorrect Credentials

I am trying to communicate with my company's API in my iOS app. I am using the standard URLSession. The API will load balance and redirect to a different server automatically, so I've implemented the URLSessionDelegate and URLSessionTaskDelegate…
adamacdo
  • 426
  • 1
  • 6
  • 14
3
votes
1 answer

How to change credentials for NSURLSession

I have the following problem: I am making requests to a server, which uses HTTP basic auth and gives me a 401 if I do not send authentication a 401 if I send invalid authentication a 403 if I send valid authentication but the resource is forbidden…
3
votes
0 answers

iOS how to properly retrieve a credential from NSURLCredentialStorage?

I'm running into an issue where I can't retrieve a credential from NSURLCredentialStorage, even if I try this immediately after saving. The credential is properly formatted and is accepted by the server, it is set to be permanent. I have debug code…
Alex Stone
  • 46,408
  • 55
  • 231
  • 407
2
votes
0 answers

Using NSURLSession with NSURLCredentialStorage and NSURLAuthenticationMethodClientCertificate

I am trying to avoid using - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential…
2
votes
0 answers

NSURLCredentialStorage not work in iOS 7

hope i'm not unique iOS 7 victim :) I have an application that synchronize its database with my web service, in my synchronization flow there is 14 call to web services, using Windows Authentication. All this call are inside a separate thread. I…
2
votes
1 answer

cleaning out credentialsForProtectionSpace to have only one key value set. NSURLCredentialStorage

I am learning about the NSURLCredentialStorage and have a situation. As I am developing my app I happened to store two usernames with passwords using the following code. The problem I have is, there is no need to store the two sets of uname/pword…
Nungster
  • 726
  • 8
  • 28
1
vote
1 answer

is [NSURLCredentialStorage sharedCredentialStorage] thread safe?

Is it safe to manipulate the object obtained from [NSURLCredentialStorage sharedCredentialStorage] from a non-main thread context (E.G. a serial dispatch queue?) when there's a web view control on the main thread?
Sparky
  • 2,694
  • 3
  • 21
  • 31
1
vote
2 answers

NSURLCredentialStorage default credential not used automatically

I'm switching from NSURLConnection to NSURLSession for my app communications and, while I'm at it, trying to move from delegated authentication to utilising NSURLCredentialStorage. I've moved over the code however I'm getting…
Red Nightingale
  • 669
  • 3
  • 19
1
vote
1 answer

How to remove NSURLCredential storage for https authentication in iOS

I need to remove the NSURLCredential storage everytime after response received for every https request. That is not happening in my case. The below method is executed only for the first time request, for next requests it is not called. When i…
0
votes
1 answer

NSURLCredentialStorage setDefaultCredential: doesn't work for [NSURLSession sharedSession]

I'm stumped: my app needs to connect to a server which uses self-signed certificates for HTTPS and requires client-side authentication. Worse, I actually need the iOS media player to connect to that server, so I have followed Apple's instruction for…
0
votes
1 answer

How to Share NSURLConnection credentials with Safari?

I'm trying to intercept link and login a user, then send them on to Safari and have the page load with no authentication request. So, what I'm doing so far... I register a custom URL scheme for my app. Call it "myhttp". Now someone clicks on a link…
DBD
  • 23,075
  • 12
  • 60
  • 84
0
votes
1 answer

NSURLProtectionSpace - Handling sub directories in the same host

Is there anyway to store the sub directory when the protection space is saved in the NSURLCredential storage. Tried subclassing NSURLProtectionSpace but no result of accessing the property. adding the postfix to the host property and…
Dhammini F.
  • 339
  • 3
  • 17
-1
votes
1 answer

Check if NSURLCredential exists

I'm looking for a way to check if a concrete NSURLCredential is stored in my app. I'm trying to get it from NSURLCredentialStorage but I'm not founding the way to do it. Do you know if there is a way to check it? Thanks.
Alex
  • 6,957
  • 12
  • 42
  • 48