views:

1599

answers:

2

Probably Duplicate of

i want to write an http authentication program for iphone. should i do it using soap request or NSURLConnection?

Please give me one good link where i can get help how to do it step by step ,

Regards,

+2  A: 

NSMutableURLRequest is probably most flexible for this sort of work. Take a look at the solution here http://stackoverflow.com/questions/471898/google-app-engine-with-clientlogin-interface-for-objective-c

If that doesn't help can you clarify your question please.

Andiih
Hi Andiih, so kind of you for your reply. okay , let me be very much clear , i want to write a basic client end User Authentication code.
maddy
to authenticate against what ?
Andiih
+2  A: 

Maddy,

The Apple docs on NSURLConnection (http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html) have a good section on handling authentication requests.

What you'll need to do is use the async mode of NSURLConnection and define a delegate for the connection that has an appropriate didReceiveAuthenticationChallenge: method in the delegate. This method will be called if the HTTP server demands authentication. There are classes in the SDK that assist with building the BASIC authentication response for this method and I believe that the aforementioned URL has some example code within that documentation.

Jack

Jack Cox