Lark OAuth
1. Create a Lark application
On the Lark Open Platform, create an application and enable it. In the app’s basic information, note App ID and App Secret. In security settings, add the redirect URL: <your-casdoor-domain>/callback (e.g. https://door.example.com/callback).

2. Create the provider in Casdoor
Providers → Add. Set Category to OAuth, Type to Lark. Map:
| Casdoor | Lark |
|---|---|
| Client ID | App ID |
| Client secret | App Secret |

Username handling
Casdoor chooses the username from Lark’s response in this order: UserId (preferred), UnionId (links users across Lark orgs), OpenId (fallback, always present). This keeps sign-in working even when some fields are missing.