- Stitch >
- Users & Authentication >
- User Management
Working with Multiple User Accounts¶
On this page
Overview¶
The Stitch Client SDKs allow multiple users to log in at the same time. When multiple users are logged in to an app, one of them is the active user for Stitch requests. You can switch the active user to be any other logged in user at any time; this allows users to quickly switch between logged in accounts on a shared device.
Definitions¶
- Logged-in user: a user account that has logged on with one of the Stitch Authentication providers and has not been logged out or removed. A logged-in user may be an active or inactive user.
- Active user: the one logged-in user account that can currently make calls to Stitch. Any data displayed in the app is data that the active user has permissions to read. See active users for more information.
- Inactive user: a user account that is not currently the active user but is logged in.
- Logged-out user: a user account that exists on the app but has logged out. The user is still associated with the device but cannot become the active user until they log in again.
User Account State Diagram¶
The following diagram explains the state of user accounts in your app when different events occur.

Use Cases¶
The examples in this section demonstrate how to use methods from the Client SDKs to manage multi-user authentication in a client application.
Log in as two different users¶
The following code demonstrates how your app can support more than one user logging in.
- JavaScript SDK
- Android (Java) SDK
For details on the methods, classes, and interfaces used in this code, see
For details on the methods, classes, and interfaces used in this code, see
List users¶
The following code demonstrates how you can get a collection of all user accounts that are on the device.
- JavaScript SDK
- Android (Java) SDK
For details on the methods, classes, and interfaces used in this code, see
For details on the methods, classes, and interfaces used in this code, see
Switch users¶
The following code demonstrates switching which user account is the active user.
- JavaScript SDK
- Android (Java) SDK
For details on the methods, classes, and interfaces used in this code, see
For details on the methods, classes, and interfaces used in this code, see
Remove the active user¶
The following code shows how to remove the active user from your app.
- JavaScript SDK
- Android (Java) SDK
For details on the methods, classes, and interfaces used in this code, see
For details on the methods, classes, and interfaces used in this code, see
Remove a specific user account¶
The following code demonstrates removing a user account
by passing that account’s id
.
- JavaScript SDK
- Android (Java) SDK
For details on the methods, classes, and interfaces used in this code, see
For details on the methods, classes, and interfaces used in this code, see