Overview
As an authentication platform, Casdoor can easily manage users stored in databases.
Syncer
Casdoor stores users in the user table. So, when you plan to use Casdoor as an authentication platform, there is no need to worry about migrating your application's user data into Casdoor. Casdoor provides a syncer to quickly help you synchronize user data to Casdoor.
Casdoor supports multiple syncer types to import users from different sources:
- Database: Synchronize users from any database supported by Xorm (MySQL, PostgreSQL, SQL Server, Oracle, SQLite). See database syncer.
- Azure AD: Synchronize users from Azure Active Directory using Microsoft Graph API. See Azure AD syncer.
- Active Directory: Synchronize users from Microsoft Active Directory via LDAP. See Active Directory syncer.
- Google Workspace: Synchronize users from Google Workspace using Admin SDK API. See Google Workspace syncer.
- Keycloak: Import users directly from Keycloak databases. See Keycloak syncer.
- WeCom: Fetch users from WeCom organizations via API. See WeCom syncer.
Each syncer type implements a common interface, making it straightforward to add new syncer types or extend existing ones without affecting other parts of the system.
Synchronization hash
Casdoor uses a hash function to determine how to update a user. This hash value is calculated for each user in the table, using information such as the password or mobile phone number.
If the calculated hash value of a user with a specific Id changes compared to the original value, Casdoor confirms that the user table has been updated. Subsequently, the database updates the old information, thereby achieving bilateral synchronization between the Casdoor user table and the original user table.