How does authentication/authoriation work with multi region api in a DNS fail-over scenario?

0

I want to set up a multi region api with DNS-fail over setting , by setting up health checks. I plan to set up api key for my api endpoint. say, if i create api gateway resource in two regions us-east-1 and us-west-1, with api key. i assume it will create different api keys for my api in each region. so if request comes into an api hosted in us-east-1 with a particular api key, and if us-east-1 fails and then request is routed to us-west , it should fail because the api key are different?

1 回答
1
已接受的回答

You have the option to either have API Gateway generate API keys for you or you have the option to import API keys. If you use the import option, you can ensure that the same API Keys are used for a particular client for both your regional API Gateway end-points.

Look at the "Import API Keys" section in https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-setup-api-key-with-console.html#api-gateway-usage-pan-import-apikey

As a side note, you should not use API Keys for Authentication and Authorization. API Keys are only meant for implementing Usage Plans for clients.

You can use mechanisms such as Cognito User Pools, Cognito Identity Pools, Lambda Authorizers etc. for Authentication and Authorization in API Gateway

profile pictureAWS
专家
已回答 2 年前
profile pictureAWS
专家
已审核 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则