title: API Gateway (Azure, AWS) traffic routing based on JWT issuer claim
body: <p>I have a question about routing traffic within an API gateway using policies.</p>
  <p>I wish to call different backend servers based on a claim (issuer) in the user's JWT (JSON Web Token) from the same API gateway endpoint.</p>
  <p>Specifically, can I write a policy to do JWT claim based routing just like I can use HTTP Headers in the policy, or will I have to call a lambda or azure function and then call the backend services by inspecting the token in the lambda ?</p>
  <p>We are trying to centralize the access to the APIs on our multiple server instances and our use case is given below. Can you please advice :-</p>
  <ul>
  <li>1.a - <strong>UserA</strong> gets Access Token from <strong>ServerA</strong> Auth Services</li>
  <li>2 - <strong>UserA</strong> calls the <strong>API Gateway</strong></li>
  <li>3 - <strong>UserA</strong> is routed to <strong>ServerA WebAPI</strong> based on his Token's issuer claim (ServerA)</li>
  <li>1.b. - <strong>UserB</strong> gets Access Token from <strong>ServerB</strong> Auth Services</li>
  <li>2 - <strong>UserB</strong> calls the <strong>API Gateway</strong></li>
  <li>3 - <strong>UserB</strong> is routed to <strong>ServerB WebAPI</strong> based on his Token's issuer claim (ServerB)</li>
  </ul>
  <p><a href="https://i.stack.imgur.com/MXoqQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MXoqQ.png" alt="enter image description here" /></a></p>
  <p>Please advice.</p>