Questions tagged [nsurlcredential]

NSURLCredential is an immutable object representing an authentication credential consisting of authentication information specific to the type of credential and the type of persistent storage to use, if any.

67 questions
0
votes
1 answer

how can I use build URLCredential with 2 perm file?

I have one piece of python code that need to transfer into swift code. I see lots of example using URLSessionDelegate and URLCerdentital. I see the signure for URLCredential is .init(identity: <#T##SecIdentity#>, certificates: <#T##[Any]?#>,…
jacobcan118
  • 7,797
  • 12
  • 50
  • 95
0
votes
0 answers

How to do Client Certificate Authentication using NSURLSession with background session configuration?

My application backend requires Client Certificate authentication. If I configure NSURLSession with default configuration, didReceiveChallenge delegate gets called where I am providing valid client certificate. It successfully completes the task.…
0
votes
1 answer

How can I enable access of NSURLCredentials when an iOS Device is locked?

I am using a Swagger generated Swift Client which uses NSURLCredentials to authenticate with a server. I am using persistence type .Permanent My app communicates with the server in the background and works fine, except when I lock the phone (I see…
Dylan Colaco
  • 325
  • 2
  • 11
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

AFNetworking 3.0 migration

Now I am using AFNetworking 2.0, I want to migrate it to AFNetworking 3.0. I've added files to the project, it shows many errors. I've checked the migration guide. My doubt is how to set NSURLCredential to the login request url in AFNetworking…
0
votes
0 answers

Certificate based client authentication in iOS does not work until i restart the application

When I download p12 file from server and set it to NSURLCredential like this: - (NSURLCredential *)getCredential { NSURLCredential *credential = nil; NSString *thePath = //Certificate path NSData *PKCS12Data = [[NSData alloc]…
igitgor
  • 66
  • 4
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

iOS how to reset NSURLCredential for a given server or make my app forget it ever spoke to that server?

I'm looking for a way to implement being able to switch which NSURLCredential my web app is using to talk to a given server. Is there a way for me to "reset" NSURLCredential ssl credentials for a given server trust and force the entire handshaking…
Alex Stone
  • 46,408
  • 55
  • 231
  • 407
0
votes
1 answer

What is the appropriate NSURLConnection/Credential pattern for doing NTLM web service calls?

I have a "traditional" enterprise iPad application that needs to make many different web service calls over its lifetime using NTLM authentication. Upon start up of the application, I anticipate getting the user name and password off of a keychain…
0
votes
1 answer

Objective-C wait for response after NSURLAuthenticationChallenge

I'm new to objective C. I'm creating a mobile version of a website that requires a log in. I am trying to figure out how to allow a username and password to be passed in after a NSURLAuthenticationChallenge is received. Here is my code: Session.m //…
Jared Price
  • 5,217
  • 7
  • 44
  • 74
0
votes
1 answer

AFNetworking 2.0: How to persist an NSURLCredential across app launches

I am creating an NSURLCredential with NSURLCredentialPersistencePermanent and using it to authenticate an AFHTTPRequestOperation as follows: AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc]…
titaniumdecoy
  • 18,900
  • 17
  • 96
  • 133
0
votes
0 answers

Client SSL authentication with NSURLConnection doesn't work on OS X 10.7

I'm writing an HTTPS client, which authenticates itself to the server using a certificate in the keychain. For that, I implement connection:willSendRequestForAuthenticationChallenge: delegate. Everything works on 10.8, but I'm getting an error on…
rincewind
  • 1,103
  • 8
  • 29
0
votes
1 answer

NSURLConnection doesn't call NSURLConnectionDelegate authentication methods after an HTTP 401

I'm consume a web service that uses HTTP basic auth with an NSURLConnection. In my NSURLConnectionDelegate, I implemented –[NSURLConnectionDelegate connection:canAuthenticateAgainstProtectionSpace:], –[NSURLConnectionDelegate…
0
votes
2 answers

NSURLCredential crashes without any information - Certificate Based authentication

In my app, i need to authenticate the user based on a certficate. This is how i do it 1. First of all, i export the certificate into the sandbox. 2. Then i extract the SecIdentityRef from the certificate, add it to the keychain and later delete the…
Mani
  • 561
  • 3
  • 8
0
votes
1 answer

NSURLRequest with UTF8 password

Here is a method I've written to connect to a server and get a user auth token: + (void)getAuthTokenForUsername:(NSString *)username password:(NSString *)password completionHandler:(void (^)(NSString *, NSError…