Live Chat

We'll need to share your messages (and your email address if you're logged in) with our live chat provider, Drift. Here's their privacy policy.

If you don't want to do this, you can email us instead at contact@anvil.works.

User Management

The Users Service handles signup, login and user permissions, and provides a range of functionality to make user management easy and flexible.

To add user management to your app, you must first enable the Users Service in the App Browser:

Get a login form in one line

You can present a signup/login form with a single line of code. This handles signup, login, email verification, password reset and ‘remember me’. See Presenting a Login Form for details.

Building the process yourself

If you want to build your own login form or customise your signup/login workflow, see our how-to guide.

There are also a number of functions such as anvil.users.logout() that let you run the steps of the user management process manually. See Logging in Using Code or the API Reference to learn what functions are available.

The user account options

In addition to username and password, you can allow your users to log in with their existing Google, Facebook or Microsoft accounts. Anvil also has built-in local Active Directory (AD) and PKI Certificate systems for Enterprise users. See Authentication Choices for more information.

How user information is stored

If you’re using the Users Service, user accounts are stored in a Data Table called ‘Users’. The password is bcrypt hashed for you and the rest of the relevant user details are processed and added to the ‘Users’ Data Table. See the Users Table for more information.

You can add your own columns to this Data Table - it’s common to add a role column to store user roles for permissions management.

Checking user permissions

You can get the currently logged-in user using anvil.users.get_user(). This returns a row from the Users table.

This allows you to set up Python code in your Server Modules that checks usernames or roles before running particular code or returning particular data. This is Anvil’s authorisation model. See User Permissions for more detail.