title: Spring Boot + REST Api + Social Login
body: <p>I need to develop some backend application using spring boot (the best will be 2.0 but 1.5 is ok too) which will allow oauth login with facebook and google.
  I have following requirements:</p>
  <ul>
  <li>backend will enable login with google or facebook (and on first login backend have to remember user in DB),</li>
  <li>backend will publish ONLY rest endpoints,</li>
  <li>frontend will login into facebook or google and then it will send token to backend, backend will validate token in facebook or google (obviously it depends on token provider) and return some json data.</li>
  </ul>
  <p>How can i achieve that? I have seen many tutorials but all of them assume that backend and frontend are connected into one application. For some reasons I really don't want that solution: this backend will propably publish data for few applications.
  Can you please help me with that? I mean some tutorials, code repo etc...</p>