I’m doing some experimenting with serverless and authorizers for my API. I have a usecase where I have two different apps, one iOS and one Angular. The iOS app uses developer authentication with federated identities since it authenticates with a third party api, and the Angular app uses Cognito Userpools for authentication.
So i can specify a function with a User Pool authorizer and that works fine, and for my developer authentication users i’m using AWS_IAM authorizer and that works fine too.
But now i want my developer authenticated identities and my user pool users to be able to access the same api gateway endpoint. So how can I use two different types of authorizers for one endpoint?
Anyone with some experience in this that could point me in the right direction?
An API can have multiple custom authorizers and each method within your API can use a different authorizer. For example, the POST method for the /login resource can use a different authorizer than the GET method for the /pets resource.
The API gateway acts as a reverse proxy that accepts all API (Application Programming Interface) calls, aggregates the various services needed to execute them, and returns appropriate results. There are two types of custom authorizers. Tokens and Requests. The token authorizer is the simplest.
I actually had the same problem. I ended up building a custom authorizer for this.
On the authorizer you can always do both validations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With