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

Send notifications to Slack

This guide explains how to send the notifications of Casdoor to a Slack channel.


Learning outcomes​

  • Create a Slack app with a bot token.
  • Add Slack as a notification provider in Casdoor.

What you need​

  • A Slack workspace in which you may create apps
  • Administrator access to the Casdoor admin console

Create a Slack app​

  1. On Slack API, create an app and add the bot scopes chat:write and chat:write.public.

    Scopes of the Slack app

  2. Install the app to the workspace, and copy the Bot User OAuth Token from OAuth & Permissions.

    Bot token of the Slack app

  3. Find the ID of the channel: in the details of the channel, or at the end of the link that Copy link gives.

    Channel ID in Slack

Add the provider in Casdoor​

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

  2. Set Category to Notification and Type to Slack.

  3. Fill in the fields:

    Casdoor field値
    Secret keyAccess Token
    Chat IDChannel ID
    ContentMessage template (optional)

    Slack notification provider in Casdoor

  4. Click Send Testing Notification, and save the provider.

See also​