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.

How can I determine the OS user in AppSmith

Issue

I am unsure if I can determine the OS user in Appsmith and if there is access to System.getProperty("user.name"). I need to know if this feature is supported or not as I am self-hosting Appsmith. I reached out to ask, but I need confirmation on how to determine the user. An engineer said it's not possible to get the OS username but I can extract the name of the user logged into the application using {{appsmith.user.name}} according to the Appsmith Context Object documentation.

Resolution

The user cannot determine the OS user in AppSmith. However, it is possible to extract the name of the user logged into the application using the context object provided by AppSmith. The relevant code to obtain the user's name is {{appsmith.user.name}}. This context object provides information regarding the current state of the application, including the user information. Therefore, developers can use this object to access user information and customize their application accordingly.