In the example above, we’re using Amazon Cognito to issue our clients a JWT. We are not using any other AWS features (like the ALB integration), because it was not feasible for our use case. When the user sends an app request, it’ll go through the Envoy proxy. For every request, Envoy will check with the authorization server, whether the request is authorized to go through. The authorization server can respond with an OK or Permission denied. If the request can go through, the authorization server can also optionally add extra data to the request, for example, to provide the application server with headers for extra authorization information.
If the application server wants to revoke the JWT before it expires, it can publish a message to the Kinesis Stream. That message will then be picked up by the authorization server and added to its internal cache. When a new request comes in, the authorization server can compare the incoming JWT to its cache, and send permission denied if the JWT matches.
This is just a simple example of how an authorization server can be used. There are many more use-cases for authorization servers in conjunction with an Envoy proxy.