NSURLCredential not working for synchronuos request in iphone -


I am using synchronous request and passing credentials, but I am getting an authentication error in reply. Below is my request code and response to server.

Requests: -

  NSURLCredential * userCredentials = [NSURL credential credentials with user: @ "username" password: @ "passwad" firmly: NSURLCredentialPersistenceForSession]; NSURLProtectionSpace * space = [[NSURLProtectionSpace alloc] initWithHost: @ "http://webaddress.inc.com" Port: 80 protocol: @ "http" realm: @ "webaddress.inc.com" authentication method: zero]; [[NSURLCredentialStorage Shared Credential Storage] Set Credential: User Credentials for Protection Space: Space]; NSMutableURLRequest * urlRequest = [NSMutableURL request request with: URL: [NSURL URLWithString: @ "http://webaddress.inc.com"] Cash Policy: NSURLCacheStorageNotAllowed Timeframe Interval: 30]; NSURLResponse * response; NSError * error; NSDT * Return Data = [Send NSRR Connection Synchronous Request: Response Returning URLRACE: And Action Error: And Edition];  

/////////// Feedback

401 authorization required


Note: If I'm sending The request with the Async request is fine that in the case that didReiveiveAuthenticationChallenge is asking them the necessary certificate.

I'm sure something in my code might be missing.

Have you ever tried an easy HP operating iPhone environment And this is really simple and good document. I used to use it inside my projects, it was doing amazing work


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -