title: Spring boot Restful API: Simple authentication
body: <p>I'm writing Restful API endpoints using Spring boot. I want to create login/logout functionality. I don't want to use Spring boot default login page.</p>
  
  <p>From my understanding, a simple and secure way to do so, is:</p>
  
  <ol>
  <li>Client provides server with username and password</li>
  <li>Server sends back an authentication code, which user can use for subsequent calls to the API endpoints</li>
  <li>The authentication code is valid until users logs out/a certain amount of time passes</li>
  </ol>
  
  <p>Is there any conventional name for this method of authentication ? </p>
  
  <p>I don't want to use Spring boot login page. Does Spring boot have any other default implementation for this authentication method ? If yes, where does it store the authentication code. Does it store in the memory ?</p>