A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-add-custom-domain.html below:

Using your own domain for managed login

Using your own domain for managed login

After you set up an app client, you can configure your user pool with a custom domain for the domain services of managed login. With a custom domain, users can sign in to your application using your own web address instead the default amazoncognito.com prefix domain. Custom domains improve user trust in your application with a familiar domain name, especially when the root domain matches the domain that hosts your application. Custom domains can improve compliance with organizational security requirements.

A custom domain has some prerequisites, including a user pool, an app client, and a web domain that you own. Custom domains also require an SSL certificate for the custom domain, managed with AWS Certificate Manager (ACM) in US East (N. Virginia). Amazon Cognito creates a Amazon CloudFront distribution, secured in transit with your ACM certificate. Because you own the domain, you must create a DNS record that directs traffic to the CloudFront distribution for your custom domain.

After these elements are ready, you can add the custom domain to your user pool through the Amazon Cognito console or API. This involves specifying the domain name and SSL certificate, and then updating your DNS configuration with the provided alias target. After making these changes, you can verify that the sign-in page is accessible at your custom domain.

The lowest-effort way to create a custom domain is with a public hosted zone in Amazon Route 53. The Amazon Cognito console can create the right DNS records in a few steps. Before you begin, consider creating a Route 53 hosted zone for a domain or subdomain that you own.

Adding a custom domain to a user pool

To add a custom domain to your user pool, you specify the domain name in the Amazon Cognito console, and you provide a certificate you manage with AWS Certificate Manager (ACM). After you add your domain, Amazon Cognito provides an alias target, which you add to your DNS configuration.

Prerequisites

Before you begin, you need:

Step 1: Enter your custom domain name

You can add your domain to your user pool by using the Amazon Cognito console or API.

Amazon Cognito console
To add your domain to your user pool from the Amazon Cognito console:
  1. Navigate to the Domain menu under Branding.

  2. Next to Domain, choose Actions and select Create custom domain or Create Amazon Cognito domain. If you have already configured a user pool custom domain, choose Delete custom domain before creating your new custom domain.

  3. Next to Domain, choose Actions and select Create custom domain. If you have already configured a custom domain, choose Delete custom domain to delete the existing domain before creating your new custom domain.

  4. For Custom domain, enter the URL of the domain you want to use with Amazon Cognito. Your domain name can include only lowercase letters, numbers, and hyphens. Do not use a hyphen for the first or last character. Use periods to separate subdomain names.

  5. For ACM certificate, choose the SSL certificate that you want to use for your domain. Only ACM certificates in US East (N. Virginia) are eligible to use with an Amazon Cognito custom domain, regardless of the AWS Region of your user pool.

    If you don't have an available certificate, you can use ACM to provision one in US East (N. Virginia). For more information, see Getting Started in the AWS Certificate Manager User Guide.

  6. Choose a Branding version. Your branding version applies to all user-interactive pages at that domain. Your user pool can host either managed login or hosted UI branding for all app clients.

    Note

    You can have a custom domain and a prefix domain, but Amazon Cognito only serves the /.well-known/openid-configuration endpoint for the custom domain.

  7. Choose Create.

  8. Amazon Cognito returns you to the Domain menu. A message titled Create an alias record in your domain's DNS is displayed. Note down the Domain and Alias target displayed in the console. They will be used in the next step to direct traffic to your custom domain.

API

The following CreateUserPoolDomain request body creates a custom domain.

{
   "Domain": "auth.example.com",
   "UserPoolId": "us-east-1_EXAMPLE",
   "ManagedLoginVersion": 2,
   "CustomDomainConfig": {
    "CertificateArn": "arn:aws:acm:us-east-1:111122223333:certificate/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
   }
}
Step 2: Add an alias target and subdomain

In this step, you set up an alias through your Domain Name Server (DNS) service provider that points back to the alias target from the previous step. If you are using Amazon Route 53 for DNS address resolution, choose the section To add an alias target and subdomain using Route 53.

  1. Sign in to the Route 53 console. If prompted, enter your AWS credentials.

  2. If you don't have a public hosted zone in Route 53, create one with a root that is a parent of your custom domain. For more information, see Creating a public hosted zone in the Amazon Route 53 Developer Guide.

    1. Choose Create Hosted Zone.

    2. Enter the parent domain, for example auth.example.com, of your custom domain, for example myapp.auth.example.com, from the Domain Name list.

    3. Enter a Description for your hosted zone.

    4. Choose a hosted zone Type of Public hosted zone to allow public clients to resolve your custom domain. Choosing Private hosted zone is not supported.

    5. Apply Tags as desired.

    6. Choose Create hosted zone.

      Note

      You can also create a new hosted zone for your custom domain with a delegation set in the parent hosted zone that directs queries to the subdomain hosted zone. Otherwise, create an A record. This method offers more flexibility and security with your hosted zones.For more information, see Creating a subdomain for a domain hosted through Amazon Route 53.

  3. On the Hosted Zones page, choose the name of your hosted zone.

  4. Add a DNS record for the parent domain of your custom domain, if you don’t already have one. Create a DNS record for the parent domain with the following properties:

  5. Choose Create records. The following is an example record for the domain example.com:

    example.com. 60 IN A 198.51.100.1

    Note

    Amazon Cognito verifies that there is a DNS record for the parent domain of your custom domain to protect against accidental hijacking of production domains. If you do not have a DNS record for the parent domain, Amazon Cognito will return an error when you attempt to set the custom domain. A Start of Authority (SOA) record isn't a sufficient DNS record for the purposes of parent-domain verification.

  6. Add another DNS record for your custom domain with the following properties:

  7. Choose Create records.

    Note

    Your new records can take around 60 seconds to propagate to all Route 53 DNS servers. You can use the Route 53 GetChange API method to verify that your changes have propagated.

Step 3: Verify your sign-in page Changing the SSL certificate for your custom domain

When necessary, you can use Amazon Cognito to change the certificate that you applied to your custom domain.

Usually, this is unnecessary following routine certificate renewal with ACM. When you renew your existing certificate in ACM, the ARN for your certificate remains the same, and your custom domain uses the new certificate automatically.

However, if you replace your existing certificate with a new one, ACM gives the new certificate a new ARN. To apply the new certificate to your custom domain, you must provide this ARN to Amazon Cognito.

After you provide your new certificate, Amazon Cognito requires up to 1 hour to distribute it to your custom domain.

Before you begin

Before you can change your certificate in Amazon Cognito, you must add your certificate to ACM. For more information, see Getting Started in the AWS Certificate Manager User Guide.

When you add your certificate to ACM, you must choose US East (N. Virginia) as the AWS Region.

You can change your certificate by using the Amazon Cognito console or API.

AWS Management Console
To renew a certificate from the Amazon Cognito console:
  1. Sign in to the AWS Management Console and open the Amazon Cognito console at https://console.aws.amazon.com/cognito/home.

  2. Choose User Pools.

  3. Choose the user pool for which you want to update the certificate.

  4. Choose the Domain menu.

  5. Choose Actions, Edit ACM certificate.

  6. Select the new certificate you want to associate with your custom domain.

  7. Choose Save changes.

API

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4