Saltar al contenido principal

Add Lark as an OAuth provider

This guide explains how to let users sign in to Casdoor with their Lark (Feishu) account.


Learning outcomes​

  • Create a Lark application.
  • Add Lark as an OAuth provider in Casdoor.

What you need​

  • A Lark or Feishu organization
  • Administrator access to the Casdoor admin console

Create a Lark application​

  1. On the Lark Open Platform, create an application and turn it on. Note the App ID and the App Secret from its basic information.

    New application on the Lark Open Platform

  2. In the security settings, add the callback URL of Casdoor, <your-casdoor-domain>/callback, for example https://door.example.com/callback, as a redirect URL.

    Redirect URL of the application

Add the provider in Casdoor​

  1. In the Casdoor admin console, go to Identity > Providers and add a provider.

  2. Set Category to OAuth and Type to Lark.

  3. Fill in the fields:

    CasdoorLark
    Client IDApp ID
    Client secretApp Secret

    Lark provider in Casdoor

  4. Save the provider.

Usernames​

Casdoor takes the username from the first of the following values that the response of Lark contains:

  1. UserId
  2. UnionId, which identifies the user across Lark organizations
  3. OpenId, which is always present

Sign-in therefore works even when some fields are missing.

Next steps​

Add the provider to an application. See Add providers to an application.

See also​