Admin Login
HomeGuidesAPI ReferenceChangelogBlockdaemon Main Docs
Log In
Guides

Amazon Cognito IdP Configuration

✔️ Configuring Amazon Cognito for your wallet and approver application!

This is a prerequisite configuration before you deploy your online wallet. In this guide, we will walk you through the steps to configure an Amazon Cognito user pool for your wallet and approver application.

Prerequisites

Before you begin, make sure you have the following prerequisites in place:

  • An AWS account with permission to create and manage Amazon Cognito user pools.
  • The URL of your wallet front-end (e.g., https://wallet.yourcompany.com). The callback URLs below must match it exactly.

Step 1: Create Required Resources

To configure Amazon Cognito for your wallet and approver application, you need to create the following resources:

  1. User Pool and Wallet Application The user pool holds your users. The console creates the first app client with the pool; use it for your wallet application, which runs in a web browser.

    1. Sign in to the AWS Management Console and open Amazon Cognito.
    2. Click Create user pool.
    3. Under Application type, choose Single-page application (SPA) and provide a name (e.g., "Wallet App").
    4. Under Options for sign-in identifiers, select Email.
    5. Under Required attributes for sign-up, select email.
    6. Under Add a return URL, enter the full URL of your wallet front-end, ending with /login/callback (e.g., https://wallet.yourcompany.com/login/callback).
    7. Click Create your application.
    8. In the new user pool, go to Branding > Domain. If the pool has no domain, create one and choose Managed login as its branding version. Cognito sets the audience of access tokens only for sign-ins through managed login.
  2. Resource Server (Wallet API) This resource represents the API that your applications communicate with. Its identifier is the audience of the access tokens your wallet receives.

    1. In your user pool, go to Branding > Domain, locate Resource servers, and click Create a resource server.
    2. Provide a Resource server name (e.g., "Wallet API").
    3. Set the Resource server identifier to a URL that starts with https:// (e.g., https://wallet-api.yourcompany.com). Cognito only accepts audiences in URL form.
    4. Under Custom scopes, add a scope named access with a description (e.g., "Access the Wallet API").
    5. Click Create.
  3. Native Application (Approver App) This resource represents your approver application, which runs natively on a device (e.g., mobile or desktop).

    1. In your user pool, go to Applications > App clients and click Create app client.
    2. Under Application type, choose Mobile app and provide a name (e.g., "Approver App").
    3. Enter com.blockdaemon.reactnativeapproverapp://callback as the Return URL.
    4. Click Create app client.

Step 2: Configure Application Settings

Once you have created the required resources, you need to configure the settings for each app client.

Configuring Wallet Application (SPA)

  1. Go to Applications > App clients and select your wallet application (e.g., "Wallet App").
  2. Locate Login pages, click Edit, and configure the following:
    • Allowed callback URLs: the full URL of your wallet front-end, ending with /login/callback (e.g., https://wallet.yourcompany.com/login/callback).
    • Allowed sign out URLs: the full URL of your wallet front-end (e.g., https://wallet.yourcompany.com).
    • OAuth grant types: Authorization code grant only.
    • OpenID Connect scopes: OpenID, Email and Profile.
    • Custom scopes: the scope of your resource server (e.g., https://wallet-api.yourcompany.com/access).
  3. Click Save changes.
  4. Confirm the app client has no client secret (public client).
📘

Note:

Cognito has no offline access setting. It issues a refresh token with every authorization code sign-in, and the app client's Refresh token expiration sets how long a wallet session can last without signing in again.

Configuring Approver Application (Native)

  1. Go to Applications > App clients and select your approver application (e.g., "Approver App").
  2. Locate Login pages, click Edit, and configure the following:
    • Allowed callback URLs: add entries for both approver apps:
      • com.blockdaemon.reactnativeapproverapp://callback (Mobile ApproverApp)
      • app://com.blockdaemon.approver/callback (Desktop ApproverApp)
    • OAuth grant types: Authorization code grant only.
    • OpenID Connect scopes: OpenID, Email and Profile.
  3. Click Save changes.
  4. Confirm the app client has no client secret (public client).

Verifying User Email Addresses

ApproverApp onboarding checks the email_verified claim on the ID token unless Policy Nodes allow unverified email, so verify each user's email address. When you create a user under User management > Users, select Mark email address as verified. Users who sign up themselves verify their address with the code Cognito emails them.

Step 3: Finding Values for Your Apps

You will need the following values from your Cognito configuration to set up your Wallet and Approver applications.

  • Issuer URL: https://cognito-idp.<region>.amazonaws.com/<user-pool-id>
    • Location: the User pool ID on the user pool's Overview page; the region is its first part (e.g., us-east-1 in us-east-1_EXAMPLE).
    • Do not add a trailing slash, and do not use the managed login domain or a custom domain. The wallet and the ApproverApp recognize Cognito by the cognito-idp. address.
  • Wallet App Client ID: [Enter your Wallet App Client ID here]
    • Location: Applications > App clients, select your Wallet App, and find the Client ID.
  • Approver App Client ID: [Enter your Approver App Client ID here]
    • Location: Applications > App clients, select your Approver App, and find the Client ID.
  • API Audience: [Enter your resource server identifier here] (e.g., https://wallet-api.yourcompany.com)
    • Location: Branding > Domain, under Resource servers.

Supply these as ISSUER, CLIENT_ID_SPA, CLIENT_ID_NATIVE and AUDIENCE. See OIDC IdP Configuration for where each value is used.

🗣️ We Are Here to Help!

Please contact us via email or support chat if you encounter an issue, bug, or need assistance. Don't forget to include any relevant details about the problem. To request a wallet form and Institutional Vault Approver form, please click here or contact our sales team.


Did this page help you?