开发者

ASP.NET MVC authentication for iPhone application

开发者 https://www.devze.com 2022-12-23 21:43 出处:网络
This is for an ASP.NET MVC application.For browser based access on my normal controllers, I\'m using standard forms authentication and auth cookies.

This is for an ASP.NET MVC application. For browser based access on my normal controllers, I'm using standard forms authentication and auth cookies.

My question is how I do the same for an iPhone application. I have a set of RESTful controllers that the iPhone application uses directly, but I'm not sure how to go about authentication...

I was thinking of having a special Login method that returns the auth cookie. Then I can use the standard Authentication attribute on the ASP.NET MVC side, but I'm not sure how to handle this on the iPhone side? Can I store this cookie and have it automatically sent with eve开发者_运维知识库ry request?

Perhaps there's a better approach altogether?


If it is RESTful you can use an NSURLConnection and send your server the appropriate HTTP headers the API requires.

http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html

0

精彩评论

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

关注公众号