How to create a custom login page for External Apps

Hello everyone! :wave:

Here is a step by step guide on how to create External Apps with a custom login page. External apps are available on the Business plan or above. If you'd like to explore whether this plan meets your organization's needs, feel free to book a demo here.

  1. Enable external apps.
  2. Create a custom login page.
  3. Create a landing page.
  4. Manage user permissions.
  5. Troubleshooting

Setup

The first step is to enable external apps. We can do this by going to Settings -> External Apps -> Enable external apps.

Then, specify the domains we'll use for internal users:

After clicking 'Continue,' we'll see the External Users Permission Group:

As well as the External Apps folder:

Now that our org is set up for external apps and users, let's create our custom login page!

Custom Login Page

The login page is part of Branding. We can choose to keep the Retool managed page or create a custom one. For the latter, we must create a public app, and we can do this from the Branding settings page. Go to Settings -> Branding and click 'Manage.'

Select an existing public app or create a new one:


Note: I decided to go for mydomain.retool.com/app/login but we can customize it to our preference.

This will create a great template for us to build on top:

The template will include a Resource query:

As we can see in the settings for this Resource, the email and password fields are already set to the values of the input components on the form. If we created an app from scratch, we would have to add the necessary components and a Resource query with 'User Action' as the resource, 'Account' for the type and 'Log in' for the action.

Do not add an event handler to navigate the user after a successful login. We'll set a custom landing page for our external users instead.

Users of any org can decide if they want to login with email & password credentials, or with Google. The button to sign in with Google already has an event handler configured:

If we have a custom domain, we should replace login.retool.com with our domain to ensure that the Google sign-in page displays our domain instead of Retool.com.

External App

For the first external app, we'll create the landing page, where external users will be redirected after login.

If we'd like a template, we can get it by going to Settings -> External apps -> Create a landing page -> Create a new app.

Here is the template:

I personally prefer to start from scratch. If you prefer this as well, go to Apps -> /External Apps and create an app in that folder:

Here is an example:


Note: Here is the JSON for this app if you would like to build yours on top of mine:

External App example.json (72.9 KB)

Removing the Retool branding/menu located at the bottom left of the UI is now possible on a Business plan or above. To do this, go to Settings -> Branding -> User menu -> Hide menu

Back on the app, in order to make it easier for my users to logout, I added a button with an event handler that triggers this Resource query:

To make this app the home page for our external users, go back to Settings -> External apps -> Create a landing page and select the newly created app:

Permissions

The last piece of the puzzle is managing User Permissions. As of right now, if an external user went to mydomain.retool.com, they'd see the custom login page and then get redirected to the landing page. However, if after login they went to mydomain.retool.com, they would see this:

This happens due to the 'All Users' permissions group, which automatically includes all users and, by default, grants them permissions to edit all apps:

My recommendation is to remove all permissions for this group, and set granular permission for all other groups. To do this, select 'Define specific app access' and don't forget to save changes as these are not automatically saved.


Note: Make necessary permission changes to Resources and Workflows.

Then go to the 'External Users' group and provide use-only access to the apps inside the external apps folder:


This should already be the default. The half filled squared means that these apps are inheriting the use only permission because they belong to this folder (default, definitely ok to keep). If we wanted more granular permission, we could select use permission for specific apps.

Troubleshooting

1. External user is stuck on the login page.

Make sure that the custom login page isn't using an event handler to 'Go to App' after the success of a login query, especially when using "Sign in with Google." This can cause users to see the login page multiple times after logging in. The issue occurs because signing in with Google triggers a redirect to Google's sign-in page (success = redirect). At this point, the user hasn’t been authenticated yet, but they’re redirected to the new app while still going through the login process. Since they aren’t signed in, they’re then sent back to the login page, which is what they’ll see after completing the Google sign-in.

2. Can't access the login page as an editor.

Be careful with page load events that navigate users to other apps. Specially if we are referencing the current_user. For example, if we add this logic to the login page:

if (current_user){
  utils.openApp("uuid-of-landing-page")
}

We may not be able to access the login page as an admin or editor because we are also logged in when editing apps.

El Fin

4 Likes

Hi Paulo!

As a frequent user of external apps, I've run into a significant limitation when it comes to managing External Users. The current API only allows sending invites, but it doesn't provide control over user management—like removing users or checking how many external users there are. This becomes a task that only an admin can handle.

If I wanted to build an app to manage these tasks—such as inviting, removing users, or viewing group permissions—it wouldn't be possible because the 'Users' API is gated to Enterprise.
I'm curious why this level of control is restricted to Enterprise plans, especially when External Apps are also available for Business Plans.

Has anyone else faced this challenge? How are you managing external users with these limitations?

Hi @JuanPablo,

Creating this type of user management dashboard is only possible on an Enterprise plan due to the current limitations of our API. When we designed External Apps, we actively gathered customer feedback. They expressed the need to:

We took this feedback into consideration and implemented these features on the Business plan. Additionally, we introduced 9 API endpoints to the same plan, specifically for user invitations and attributes management:
​​

For some context on our pricing and feature gating from our CEO: Over the past few years, we've made multiple changes where we've lowered our pricing. For example, in 2022, we started making Retool free for all teams with less than 5 people. In 2023, we changed our pricing from "same price for all users" to "cheaper price for end-users", this year we even dropped these prices again for external users:

In the future, our leadership team expects us to continue delivering more value to customers (whether through new products, better products, or lower pricing). This will especially be true as we move more upmarket, where larger customers are more comfortable paying higher prices (for enterprise features). As that happens, we will use that revenue to fund making Retool cheaper for all developers, including SMBs.

With this in mind, we also completely understand that there may be cases where the plan levels, features included, and price are not the right fit for everyone who's interested in them. We do see, hear, and take this feedback into account. Thank you for taking the time to share your feedback.

1 Like

I'm trying to create a custom sign up flow in business plan. By custom what I essentially mean is they should be able to set-up their account on the app itself without having to go to the email to verify and accept the invite.

Hi @Vinyasa_Health,

The only way to add a user to an organization without an email invite is by making a POST request to /users which is only possible with an Enterprise plan using the Retool API.

The primary features that are relevant to External Apps, but only available on Enterprise are:

  • The ability to fully whitelabel your email (i.e., have it come from your own email domain).
  • The ability to use Spaces to separate out customers.
  • SSO, except for the Google SSO method for the login user action.
  • Retool API, except for the endpoints shared above.

Hi Juan,
We have the same challenge you outlined (also currently on the Business Plan). We need to have a way of onboarding users both to Retool and our Backend system, but without access to the /Users API it's doesn't look straight forward i.e. Feel like we need to build a complex workaround without the access to User API.

Stephen

1 Like

Agree! If the cost of each user is like 10 USD at least we should be able to create them using USERS API and not limited only send the invite.

1 Like

There are no current plans to include this endpoint in the Business plan. However, thank you for your feedback, we've shared it internally for consideration.

1 Like