跳到主内容

将通知发送到 Twitter

本指南详细说明了如何将 Casdoor 的通知发送给 Twitter (X) 用户。


学习目标​

  • 获取 Twitter 应用的凭证和接收者的 ID。
  • 在 Casdoor 中添加 Twitter 作为通知提供商。

所需条件​


获取凭证​

  1. 创建一个 Twitter 应用,并复制 API key、API secret、access token 和 access token secret。请参阅 API key and secret。

    Credentials of the Twitter app

  2. 查找接收者的数字用户 ID。Twitter 不会在其 UI 中显示该 ID。请使用查询服务,例如 TweeterID。

在 Casdoor 中添加提供商​

  1. 在 Casdoor 管理控制台中,前往 Identity > Providers 并添加一个提供商。

  2. 将 Category 设置为 Notification,将 Type 设置为 Twitter。

  3. 填写以下字段:

    CasdoorTwitter
    Client IDAPI Key
    Client secretAPI Secret
    Client ID 2Access Token
    Client secret 2Access Token Secret
    Chat IDTwitter ID

    Twitter notification provider in Casdoor

  4. 点击 Send Testing Notification,然后保存提供商。

另请参阅​