In my spare time I have been working on a View Controller that can be used to asynchronously authenticate user credentials (username and password). Your application provides the code that contacts a server to authenticate, and optionally replaces the user interface that gathers the username and password. Your authentication code is called on a background thread, so you can make a simple blocking call to the server to perform the authentication, without blocking the main thread. My LoginViewController class, with its associated View file, is complete and has been posted to GitHub. I created the iOSLogin project to host the files: https://github.com/ijoshsmith/iOSLogin
The following screenshot shows code from the demo’s app delegate file, which configures the LoginViewController and displays it in a modal dialog. Notice that the View used to render the LoginViewController is determined at runtime based on a config value from the bundle’s info plist.
I wrote a simple RESTful authentication service in WCF, which I hosted on my main desktop at home. The DemoLoginOperation has code that calls that service to perform authentication. It works like a champ, even if that service is unavailable.
If you’re interested in getting an overview of how the code works, let me know and I’ll consider writing one up.