views:

177

answers:

1

Hi, I have been working on creating an RSS reader app for the iphone which allows me to view RSS from an external feed. However the project im working on I need to be able to view an Authenticated RSS feed which is behind a login. Im struggling to write the code to do this.

I need the app to ask the user to enter:

The url they wish to login to (stored and remembered in the app)
Their username used to login to access the RSS (stored and remembered in the app)
Their password used to login to access the RSS (stored and remembered in the app)
Option to remember password for next time
Option to auto login if the above option is accepted

If anyone is able to tell me how i can do this or point me in the right direction would really appreciate it!

Thanks

Tom

A: 

It depends how the login in implemented on the server hosting the RSS feed.

If it is basic http authentication, then you can use NSURLConnection and its delegate methods to provide credentials when the http request is made. Or you can supply the credentials as parameters on the URL (not secure).

If the login is some kind of script that takes input from a form and does some back end processing then you'll need to approach it differently, perhaps using a UIWebView to present the user with the login form. Then you'd need some method of obtaining the session key (or whatever is used to maintain the session) and use it in subsequent requests to get the RSS data.

Jasarien