title: How to integrate OAuth with a single page application?
body: <p>When using OAuth (2) I need a redirection endpoint in my application that the OAuth-offering service can redirect to, once I have been authenticated.</p>
  
  <p>How do I handle this in a single page application? Of course, a redirect to the OAuth-offering service is not nice here, and it may not even be possible to redirect back.</p>
  
  <p>I know that OAuth also supports a username / password based token generation. This works perfectly with an AJAX call, but requires my single page application to ask for a username and password.</p>
  
  <p>How do you usually handle this?</p>