メインコンテンツにスキップ

Lark syncer

The Lark syncer imports users from your Lark (飞书) organization into Casdoor. It authenticates as an app, walks the department tree recursively, and pulls each member's profile.

前提条件​

Create a Lark app at the Lark Open Platform. The app needs the following permissions:

  • contact:user.base:readonly — Read basic user info
  • contact:department.base:readonly — Read department structure

After publishing the app to your organization, copy the App ID and App Secret from the app's credentials page.

設定​

Create a new syncer in Casdoor (Syncers → Add) and fill in:

フィールド値
組織Target Casdoor organization
NameA unique name for this syncer
Typeラーク
Client IDYour Lark App ID
クライアントシークレットYour Lark App Secret

The database-related fields (database type, port, table name, etc.) are not used for the Lark syncer and can be left empty.

Field mappings​

Lark fieldCasdoor fieldNotes
user_idIdStable internal user ID
名前DisplayNameUser's display name
メールアドレスメールアドレスPrimary email
モバイル電話Mobile number
avatar.avatar_originアバターOriginal-size avatar URL
job_titleタイトルJob title
性別性別1 = Male, 2 = Female

OAuth login binding​

When a user is synced from Lark, their Lark user_id is stored in the lark field on the Casdoor user. Synced users can sign in via the Lark OAuth provider without a separate account link step.

Running the syncer​

Click Test Connection to verify your App ID and Secret before enabling. Toggle Is enabled for scheduled sync, or click Sync to run immediately.

The syncer fetches the complete department tree starting from the root, deduplicates users who belong to multiple departments, and handles pagination automatically.