Michael Brant
Michael Brant

Reputation: 79

Integrate Cognito with API Gateway and static credentials

So we built our service to give our users API Keys to access API Gateway and our service. Gateway acts as an endpoint for our Lambda functions.

The problem is, we got an email from Amazon saying that we hit our API Key limit of 500 keys. They said that we shouldn't be giving users API Keys because keys are meant for integrating with other services, not users. They said we should be using Cognito User Pools and our limit can't be increased. The problem is, our users build HTTP requests in a tool called ManyChat - a tool for building chat bots. Our users build dynamic requests and then save their chatbot to use that dynamic request. Our users can't go back and refresh those credentials as is necessary with Cognito tokens. The authentication method will have to use a static API Key I believe.

Is there a way to manage our users' usage while keeping the authentication credentials static?

Upvotes: 1

Views: 613

Answers (1)

vaquar khan
vaquar khan

Reputation: 11449

1) Update 401 Unauthorized response template as per your need so that it contains the WWW-Authenticate header set to 'Basic'.

2) Create a custom authorizer that match your credentialand and retyrn response.

Upvotes: 1

Related Questions