title: Server to Server communication in microservices
body: <p>I am working on microservice architecture, but I am facing some challenges in that.</p>
  
  <p>First let me give you a brief about the architecture.</p>
  
  <ol>
  <li><p>User logs in and get a signed token which will be used to call all REST APIS.</p></li>
  <li><p>There will be lot of API server where APIs are secured using Spring security and Authorized as per the user roles.</p></li>
  <li><p>Services have to interact with each other to get/update information.</p></li>
  <li><p>Every service will have the power to validate a token issue by auth server.</p></li>
  </ol>
  
  <p>Problem:-</p>
  
  <ol>
  <li><p>Everything works fine if User logs in and the same token is used and passsed to every service which is validated across.So, services dont need to trust each other as the token is passed.</p></li>
  <li><p>Now, the problem is there are some services which needs to be called from server itself without logging in. Lets say a server to server call. How will a service authenticate and authorize the call from other services.</p></li>
  </ol>
  
  <p>I read about spring Microservices but Zuul is also not the saviour here as every API server has spring security embedded and not just the API gateway.</p>
  
  <p>One solution can be that every service has its own default user with certaing roles which is used to Login->Fetch a token->call other server api with token.</p>
  
  <p>Can you please give me some pointers in server to server calls where each server is authenticated and authorized using spring security.</p>
  
  <p>Thanks. </p>