Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

From a browser, I can call an MVC controller like ../Account/Login with post parameters username and password and the browser plants a cookie such that on subsequent calls I do not need to pass in credentials for my [authorized] calls like /Account/GetUser to work.

I'm trying to do the same thing from a MonoTouch app (I think it would be the same issue from a windows forms app) and even though my /Account/Login call works, the subsequent calls act as if they are not authenticated. I assume it is because I'm not a browser and I don't have all that plumbing. True?

So, my questions is, using simple ASP.NET and forms auth, is there a way that I can get my Monotouch app to behave in a similar way to a browser app that stores a cookie?

All Suggestions (including ... dumb question) are appreciated.

Thanks

share|improve this question
    
I assume it's just a typo, but the correct attribute is [Authorize] –  Garrett Fogerlie Aug 4 '12 at 8:40
1  
Yes. You need to manually get the auth cookies from the Response stream and include them in any subsequent Requests you make. –  Jason Aug 4 '12 at 9:50
    
thanks. that is what I thought. I was hoping there was some clever way to have this happen automatically. –  Peter Kellner Aug 5 '12 at 4:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.