title: Using dropboxjs to authenticate the client with oauth 2. What about the server?
body: <p>I'm new to Oauth and server-side stuff, so please be patient with me.</p>
  
  <p>I have a web application that authenticates users with <a href="https://github.com/dropbox/dropbox-js" rel="nofollow">dropbox-js</a>. Everything is pretty straightforward. The application uses dropbox-js' <code>client.authenticate</code> function, and if the user is authenticated, the application gets automatically redirected to the initial page, where it executes the authenticate callback. From that moment on, I know I'm happily authenticated with Dropbox, and I can do stuff with the app's Dropbox directory.</p>
  
  <p>I got a public node.js server that currently does nothing. What I would like to do is:</p>
  
  <ul>
  <li>As soon as the client is authenticated, call my server and tell it that the user is authenticated</li>
  <li>If the user doesn't exist on the server database, create an entry for it him/her the user database (I don't need detailed instructions to do this). If it exists, send back the user's associated data.</li>
  </ul>
  
  <p>How can I do that in a secure way? I mean, how can the server tell that the user is a valid Dropbox user? Should the server authenticate to Dropbox on its side with the user credentials? What is the workflow in these cases?</p>