Last updated

Custom domain setup

By default, every Frontegg environment is created with a Frontegg domain ending in .frontegg.com. While this domain is functional, it may lead to unwanted cookie issues caused by third-party cookie blocking and result in a domain that doesn’t align with your brand identity.


Limitations

Note that you can configure one custom domain per environment, and up to two domains in total. If you need to configure additional custom domains, contact us. Note that custom domains for each environment are configured separately.

Configuring a custom domain

To configure custom domains, open the Frontegg portal and navigate to [ENVIRONMENT] → Configurations → Keys & domains → Domains.

To configure a new custom domain, click on Configure, and in the popup dialog box, insert your desired domain name to generate the CNAME record you need for your DNS configuration.

custom-domain


custom-domain

Best practice

A common practice is to use a subdomain as the custom domain because if your app is hosted on app.sample.com and you have an existing A record for that domain, you cannot use app.sample.com as a custom domain on Frontegg. Instead, use a subdomain as the custom domain, like auth.sample.com.


After adding the CNAME to your DNS configuration, click the Verify button. If Frontegg is able to verify the CNAME record, you will see a success message. After a successful setup, you should also see your custom domain listed on the Administration Page's Domain tab with a verified tag. Domain verification typically takes anywhere from a few minutes to a few hours.

If you see a notification that Frontegg is unable to verify your custom domain, please double-check that you entered your CNAME correctly in your DNS provider and try again.


custom-domain

Custom domain in Frontend SDKs

Note that when using a custom domain on Frontegg, that domain should also be passed in the baseUrl in the contextOptions of your Frontegg SDK that you integrated and wrapped your application with.

Managing URLs across the platform after configuring the custom domain

Once the custom domain is set up, make sure to update the following URLs to ensure everything functions correctly across your platform.

Login URL

Ensure that the login URL in your applications is updated to reflect the new custom domain.

  1. Open the Frontegg portal.
  2. Go to the Configuration section.
  3. Click Applications.
  4. Select your application.
  5. On the Settings tab, scroll down to the Login URL field.
  6. Update the URL.

Update-URL

  1. Click Save.

Context option in the code

Go to your application code and update the baseUrl within the contextOptions of your Frontegg SDK integration. This should reflect your new custom domain.

For example:

const contextOptions = {
  baseUrl: 'https://auth.yourcustomdomain.com',
  clientId: 'your-client-id',
  appId: 'your-app-id'
};
  • Replace https://auth.yourcustomdomain.com with your actual custom domain URL.
  • Replace your-client-id with your actual client ID.
  • Replace your-app-id with your actual app ID.

ACS URL if production environment and SSO is configured

If you're using Single Sign-On (SSO) and are in a production environment, make sure to update the ACS (Assertion Consumer Service) URL to match the new custom domain.


This is crucial for SSO configuration to work properly.


  1. Open the Frontegg portal.
  2. Go to the Configuration section.
  3. Click SSO.
  4. Select Service Provider → Manage.
  5. Select SAML → Manage.
  6. Enter the application URL into the ASC URL field.

SAML-URL

  1. Click Save changes.

Emails

When sending emails, make sure to use dynamic parameters for login URLs - {{LOGIN_URL}}. If dynamic parameters aren't used, manually update the login URL in the email templates as well.

  1. Open the Frontegg portal.
  2. Go to the Authentication section.
  3. Click Emails.
  4. On the Templates tab, select the required email template.
  5. Enter the dynamic or actual application URL into the *Redirect URL fields.

Email-URL

  1. Click Save changes.