Category: How do I do X?
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

Can I restrict users to access my application?

Issue

As a developer, I want to restrict access to my application to only a few users with Google accounts. I want to do this using Google authentication oAuth API and not by sharing the application. I also want to use these users/members in my coding. However, I am not sure how to implement this in Appsmith as the access control feature is still being developed.

Resolution

To give access to a few users to an application with Google account, you can use Google authentication OAuth API. You can restrict login to your application by controlling access to parts of the application/pages through role-based access control. If your database supports user roles and privileges, you can control visibility through coding by accessing the user object from which you can extract the email id of the user who is currently logged in.

For example, to access the current user's email id in Appsmith, you can use the following code: {{appsmith.user.email}}

You can refer to the Appsmith documentation for more information on access control and user object. However, if you want to restrict access to a specific few users, it's best to use Google authentication OAuth API for authentication.