Configure cross-account Amazon Cognito authorizer for a REST API using the API Gateway console - Amazon API Gateway
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Configure cross-account Amazon Cognito authorizer for a REST API using the API Gateway console

You can now also use a Amazon Cognito user pool from a different Amazon account as your API authorizer. Each account can be in any region where Amazon API Gateway is available. The Amazon Cognito user pool can use bearer token authentication strategies such as OAuth or SAML. This makes it easy to centrally manage and share a central Amazon Cognito user pool authorizer across multiple API Gateway APIs.

In this section, we show how to configure a cross-account Amazon Cognito user pool using the Amazon API Gateway console.

These instructions assume that you already have an API Gateway API in one Amazon account and a Amazon Cognito user pool in another account.

Configure cross-account Amazon Cognito authorizer using the API Gateway console

Log in to the Amazon API Gateway console in your first account (the one that has your API in it) and do the following:

  1. Locate your API and choose Authorizers.

  2. Choose Create New Authorizer.

  3. For Create Authorizer, type an authorizer name in the Name input field.

  4. For Type, choose the Cognito option.

  5. For Cognito User Pool, copy-paste the full ARN for the user pool that you have in your second account.


    In the Amazon Cognito console, you can find the ARN for your user pool in the Pool ARN field of the General Settings pane.

  6. Type the name of a header in Token Source. The API client must include a header of this name to send the authorization token to the Amazon Cognito authorizer.

  7. Optionally, provide a RegEx statement in Token Validation input field. API Gateway performs initial validation of the input token against this expression and invokes the authorizer upon successful validation. This helps reduce chances of being charged for invalid tokens.

  8. Choose Create to create the new Amazon Cognito authorizer for your API.