title: Sinatra + omniauth + Android, advice sought
body: <p>I'm developing a Sinatra app for which I'd like to use OmniAuth. So far, I have something similar to this for the web app:</p>
  
  <p><a href="http://codebiff.com/omniauth-with-sinatra" rel="nofollow noreferrer">http://codebiff.com/omniauth-with-sinatra</a></p>
  
  <p>I'd like the web app to be usable via Android phones which would use an API, authenticating by means of a token. The development of an API seems to be covered nicely here:</p>
  
  <p><a href="https://stackoverflow.com/questions/3479737/sinatra-api-authentication">Sinatra - API - Authentication</a></p>
  
  <p>What is not clear is now I might arrange the login procedure. Presumably it would be along these lines:</p>
  
  <ol>
  <li>User selects what service to use, e.g. Twitter, FaceBook &amp;c., by means of an in-app button on the Android device. </li>
  <li>The Android app opens a webview to log in to the web app.</li>
  <li>A token is somehow created, stored in the web app's database, and returned to the Android app so that it can be stored and used for subsequent API requests.</li>
  </ol>
  
  <p>I'm not very clear on how point 3 might be managed - does anyone have any suggestions? </p>