Configure OAuth 2.0 for Cognito


You must configure your app’s Cognito OAuth 2.0 client if you intend to use the User Management Service and authenticate users into your app through Amazon Cognito as identity provider.

Before you proceed, you must first obtain the Amazon Cognito credentials from the AWS Console. This includes a User Pool ID and a Client ID.

Configure the Cognito OAuth 2.0 Client in SBS

To configure the Amazon Cognito OAuth 2.0 client in SBS:

  1. Sign in to the SBS Console.
  2. In the left-hand side navigation menu, click Applications.
  3. Select your application, and then click the OAuth2 tab.
  4. Click the Cognito Client tab.
  5. Click Edit. A dialog box opens.
  6. Enter your Cognito credentials from the AWS Console (User Pool ID, Client ID), and then click Save.

SBS Console Update Cognito Client

GraphQL

To configure the Amazon Cognito OAuth 2.0 client from GraphQL:

  1. Obtain your Cognito credentials from the AWS Console (User Pool ID, Client ID).
  2. Run the updateApp mutation of the Account API and provide the previously obtained authorization details as parameters.
mutation updateApp($id: ID!, $input: UpdateAppInput!) {
  updateApp(id: $id, input: $input) {
    id
    name
    cognitoClientSecret {
      web {
        userPoolId
        clientId
      }
    }
  }
}

Make sure to replace the example variables below with your values, as applicable.

{
    "id": "YOUR_APP_ID",
    "input": {
        "cognitoClientSecret": {
            "web": {
                "userPoolId": "YOUR_USER_POOL_ID",
                "clientId": "YOUR_CLIENT_ID"
            }
        }
    }
}