title: Best approach for reusable services
body: <p>My organization has many software projects developed internally, each one has an authentication functionality. The current situation is when each team starts developing the login/signup features they start from scratch, using a new username and password database. Now, we are in the process of unifying the process by refactoring our projects to make similar functions be used be in the current and future projects, I am thinking of implementing this in two approach, I would like to discuss them with you:</p>
  <ul>
  <li>The first approach is RESTful API-based, which means an independent module for user authentication, and the applications have to consume its functions via API calls, hint; our apps are web, mobile, ERP (different technologies).</li>
  <li>The other approach is to develop the required functions as library to reference in our project to call its API (SDK) e.g. dll libraries in .NET projects.</li>
  </ul>
  <p>I think both approaches work, but I would like to know what concerns I should take care of when I am choosing between both.</p>
  <p><strong>Edit:</strong>
  I meant in my question, building services which support common use cases (foundational services) like user management as seprated module accessed via shared interface i.e. API or to just reuse its source code.</p>