How to implement Basic Authentication in API gateway

0

I have an API proxy, I want to implement Basic Authentication mechanism for it.

curl -v https://example.com/dev/test
-H "Authorization: Basic {clientID:ClientSecret - Base64EncodedValue}"

I do not want to get an access token from Cognito and make another request to the API gateway.

1개 답변
0

You can use API Gateway Lambda authorizers to validate the username and password. The Lambda would receive the request extract the Base64-encoded credentials, decode them, and then verifies the username and password against credentials from a database. The Lambda then generates a policy indicating what the user can and can't do e.g. GET /users. The policy is then cached so the Lambda authorizer isn't called on every request.

AWS
답변함 2달 전
profile picture
전문가
검토됨 2달 전
  • What is the use of "API key required" check box under the path API Gateway -> APIs -> Proxy -> Resources?

  • API keys in API Gateway are used to manage access to APIs and monitor API usage. You can configure usage plans and API keys to allow customers to access selected APIs, and begin throttling requests to those APIs based on defined limits and quotas. These can be set at the API, or API method level.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠