开发者

Newbie - Authentication headers for Iphone webservices (ASP>net MVC 3.0 REST)

开发者 https://www.devze.com 2023-02-20 19:24 出处:网络
We are developing an Iphone app that will talk to the ASP.net MVC 3.0 webservcies with RESTful Urls. Almost all the action are available for authorized users only. I am not sure how this can be accomp

We are developing an Iphone app that will talk to the ASP.net MVC 3.0 webservcies with RESTful Urls. Almost all the action are available for authorized users only. I am not sure how this can be accomplished as we use membership provider at the webservice end. How do we pass the authentication parameters *(username and password) to MVC actions from iPhone app.开发者_如何学运维 I believe iPhone can send only parameters in query string and not as request headers.. Thanks for any quick response..


I am far from an expert myself, but when you talk about the request headers don't you mean this?

NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:MyURLString]];
[urlRequest setValue:@"aValue" forHTTPHeaderField:@"field"];

You can pass any parameter you want there.


ASP.NET authentication is cookie based by default so you would have to store the cookie on the device and send it with every request

0

精彩评论

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