- Stitch >
- Users & Authentication >
- User Management
Linking User Accounts¶
MongoDB Stitch provides multiple ways for you to integrate user authentication into your apps. For this reason, you may want to provide a way for your users to link their account from one provider with another.
For example, suppose you have an app that enables users to authenticate using Google or Facebook, but also allows anonymous log in. New users of your app may explore the app’s functionality as an anonymous user. After working with the app for a while, a user decides to create an account. The user logs in using their Google credentials, and your app can link the data from their anonymous session to their account by using Stitch’s user-linking feature.
To provide user account linking in your code, add your app’s hosted domain to the list of Allowed Request Origins in General Settings and then use the linkWithCredential method of the StitchUser class. Documentation for this method can be found in the SDKs:
Usage¶
- JavaScript SDK
- Android SDK
- iOS SDK