跳到主内容

概述

作为一个认证平台,Casdoor可以轻松管理存储在数据库中的用户。

同步器

Casdoor将用户存储在user表中。 所以,当你计划使用Casdoor作为认证平台时,无需担心将你的应用程序的用户数据迁移到Casdoor。 Casdoor提供了一个同步器,可以快速帮助您将用户数据同步到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.

同步哈希值

Casdoor使用哈希函数来确定如何更新用户。 此哈希值是根据表中每个用户的信息(如密码或手机号码)计算得出的。

如果特定Id的用户的计算哈希值与原始值相比发生了变化,Casdoor确认用户表已经被更新。 随后,数据库更新旧信息,从而实现Casdoor用户表和原始用户表之间的双向同步