您能夠使用如下機制進行身份驗證和受權:html
-
資源策略容許您建立基於資源的策略,以容許或拒絕從指定的源 IP 地址或 VPC 終端節點訪問您的 API 和方法。有關更多信息,請參閱 使用 Amazon API Gateway 資源策略控制對 API 的訪問。後端
-
標準 AWS IAM 角色和策略 提供靈活、穩健的訪問控制,可應用於整個 API 或單個方法。IAM 角色和策略可用於控制誰能夠建立和管理您的 API 以及誰能夠調用它們。有關更多信息,請參閱使用 IAM 許可控制對 API 的訪問。api
-
IAM 標籤可與 IAM 策略結合使用來控制訪問權限。有關更多信息,請參閱 使用標籤控制對 API Gateway 資源的訪問。跨域
-
接口 VPC 終端節點的終端節點策略容許您將 IAM 資源策略附加到接口 VPC 終端節點,用於改進私有 API 的安全性。有關更多信息,請參閱 在 API Gateway 中爲私有 API 使用 VPC 終端節點策略。安全
-
Lambda 受權方是 Lambda 函數,它們使用持有者令牌身份驗證以及由標頭、路徑、查詢字符串、階段變量或上下文變量請求參數描述的信息來控制對 REST API 方法的訪問。Lambda 受權方用於控制誰能夠調用 REST API 方法。有關更多信息,請參閱 使用 API Gateway Lambda 受權方。app
-
Amazon Cognito 用戶池可以讓您爲 REST API 建立可自定義的身份驗證和受權解決方案。Amazon Cognito 用戶池用於控制誰能夠調用 REST API 方法。有關更多信息,請參閱 使用 Amazon Cognito 用戶池 做爲受權方控制對 REST API 的訪問權限。cors
如下機制可用於執行與訪問控制相關的其餘任務:ide
-
跨源資源共享 (CORS) 可以讓您控制您的 REST API 響應跨域資源請求的方式。有關更多信息,請參閱爲 API Gateway REST API 資源啓用 CORS。函數
-
客戶端 SSL 證書可用於驗證發送到後端系統的 HTTP 請求是否來自 API Gateway。有關更多信息,請參閱生成和配置 SSL 證書用於後端身份驗證。flex
-
AWS WAF 可用於保護您的 API Gateway API 免遭常見 Web 漏洞的攻擊。有關更多信息,請參閱 使用 AWS WAF 來保護 Amazon API Gateway API 免遭常見 Web 漏洞的攻擊。
如下機制可用於跟蹤和限制您已向受權客戶端授予的訪問權限:
-
使用計劃可以讓您向客戶提供 API 密鑰 — 而後跟蹤和限制每一個 API 密鑰的 API 階段和方法的使用。有關更多信息,請參閱 建立和使用帶 API 密鑰的使用計劃。
The following mechanisms can be used for authentication and authorization:
-
Resource policies let you create resource-based policies to allow or deny access to your APIs and methods from specified source IP addresses or VPC endpoints. For more information, see Control Access to an API with Amazon API Gateway Resource Policies.
-
Standard AWS IAM roles and policies offer flexible and robust access controls that can be applied to an entire API or individual methods. IAM roles and policies can be used for controlling who can create and manage your APIs as well as who can invoke them. For more information, see Control Access to an API with IAM Permissions.
-
IAM tags can be used together with IAM policies to control access. For more information, see Using Tags to Control Access to API Gateway Resources.
-
Endpoint Policies for Interface VPC Endpoints allow you to attach IAM resource policies to interface VPC endpoints to improve the security of your private APIs. For more information, see Use VPC Endpoint Policies for Private APIs in API Gateway.
-
Lambda authorizers are Lambda functions that control access to REST API methods using bearer token authentication as well as information described by headers, paths, query strings, stage variables, or context variables request parameters. Lambda authorizers are used to control who can invoke REST API methods. For more information, see Use API Gateway Lambda Authorizers.
-
Amazon Cognito user pools let you create customizable authentication and authorization solutions for your REST APIs. Amazon Cognito user pools are used to control who can invoke REST API methods. For more information, see Control Access to a REST API Using Amazon Cognito User Pools as Authorizer.