On his blog post about [LROAuth2Client - OAuth2 for iPhone and iPad applications](http://lukeredpath.co.uk/blog/oauth2-for-iphone-and-ipad-applications.html), Luke Redpath states:

> 
> If possible, you should try and obtain the end-user and token URIs at runtime rather than hardcoding them into your application. This can be typically done by making an unauthorised request to a secure URI and obtaining them from the WWW-Authenticate header in the returned 401 response.
> 
> 
> 

Please provide example code of how this is done in order to implement [Sign in with Twitter](http://dev.twitter.com/pages/sign_in_with_twitter) on iOS.