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.

Rohit
demandé il y a 2 mois236 vues
1 réponse
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
répondu il y a 2 mois
profile picture
EXPERT
vérifié il y a 2 mois
  • 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.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions