开发者

How do IPhone apps authenticate with server side technologies?

开发者 https://www.devze.com 2023-01-06 14:18 出处:网络
W开发者_Go百科hat kind of encryption or hashing is available?Apologies if I misinterpreted the question but here goes:

W开发者_Go百科hat kind of encryption or hashing is available?


Apologies if I misinterpreted the question but here goes:

HTTPS is built into the SDK so you can access an encrypted resource using NSURLConnection. As far authenticating you can do it a few ways.

With the NSURLConnection delegate you can implement a challenge / response type authentication process. Full run down on them can be found here. You can also do session and cookie based authentication by building a NSURLRequest:

[NSURLRequest setHTTPMethod:HTTP_METHOD_POST];
[NSURLRequest setValue:FORM_ENCODING forHTTPHeaderField:@"Content-Type"];
[NSURLRequest setHTTPBody:postData];

where post data contains variables to pass for the server side technology to process. I would recommend this way as it is encrypted over HTTPS when sent.

If you require access to cookies you can access them via NSHTTPCookieStorage. If you are sending cookies with form data send it with the request:

[NSURLRequest setAllHTTPHeaderFields:cookies];

Hope that answers your question, if not let me know and I'll try again.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号