I have a question about routing traffic within an API gateway using policies.
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.
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 ?
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 :-
- 1.a - UserA gets Access Token from ServerA Auth Services
- 2 - UserA calls the API Gateway
- 3 - UserA is routed to ServerA WebAPI based on his Token's issuer claim (ServerA)
- 1.b. - UserB gets Access Token from ServerB Auth Services
- 2 - UserB calls the API Gateway
- 3 - UserB is routed to ServerB WebAPI based on his Token's issuer claim (ServerB)
Please advice.