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

Kanboard

Kanboard は、カンバンボードを使用するセルフホスト型のプロジェクト管理ツールです。その OAuth2 プラグイン は、汎用 OAuth 2.0 プロバイダーを通じてユーザーを認証します。プロバイダーとして Casdoor を使用すると、ユーザーは Casdoor アカウントで Kanboard にサインインできます。

OAuth2 プラグインのインストール​

  1. 次のいずれかの方法でプラグインをインストールします:
    • Kanboard で Settings > Plugins > Plugin Directory を開き、OAuth2 をインストールします。Web インストーラーを使用するには、config.php で PLUGIN_INSTALLER が true に設定されていること、Web サーバーが書き込み可能な plugins ディレクトリが存在すること、および PHP Zip 拡張機能が有効である必要があります。
    • プラグインをダウンロードし、Kanboard ディレクトリの plugins/OAuth2 に展開します。ディレクトリ名は大文字と小文字が区別されます。
  2. Settings > Application settings > Application URL が Kanboard の公開 URL(例: https://kanboard.example.com/)になっていることを確認してください。プラグインはこの URL からコールバック URL を構築します。

Casdoor でアプリケーションを作成する​

  1. Kanboard で Settings > Integrations > OAuth2 Authentication に移動し、Callback URL をコピーします。URL リライティングが有効な場合、次のようになります:

    https://kanboard.example.com/oauth/callback

    URL リライティングが無効な場合、https://kanboard.example.com/?controller=OAuthController&action=handler&plugin=OAuth2 となります。

  2. Casdoor 管理者コンソールで、ユーザーの組織を開き、アプリケーションを追加するか、既存のアプリケーションを開きます。

  3. コールバック URL を Redirect URLs に追加します。

  4. 保存し、Client ID と Client secret を控えておきます。

OAuth2 プラグインの設定​

  1. Kanboard で Settings > Integrations > OAuth2 Authentication に移動し、フィールドを入力します:

    FieldValue
    Client ID<your-client-id>
    Client Secret<your-client-secret>
    Authorize URLhttps://door.example.com/login/oauth/authorize
    Token URLhttps://door.example.com/api/login/oauth/access_token
    User API URLhttps://door.example.com/api/userinfo
    Scopesopenid profile email
    Username Keypreferred_username
    Name Keyname
    Email Keyemail
    User ID Keysub
    Allow Account CreationOn
    • <your-client-id>、<your-client-secret>: Casdoor アプリケーションからの値。
    • User API URL: Casdoor の UserInfo エンドポイント。profile スコープに対しては sub(Casdoor ユーザー ID)、preferred_username(ユーザー名)、name(表示名)を返し、email スコープに対しては email を返します。
    • User ID Key: Kanboard はこの値に基づいて Kanboard ユーザーをリンクします。Casdoor でユーザー名が変更されても sub は変わりません。
    • Allow Account Creation: 初回サインイン時に Kanboard ユーザーを作成します。これを有効にしない場合、アカウントをリンク済みのユーザーのみがサインインできます。
  2. Save をクリックします。

Casdoor グループの同期​

UserInfo エンドポイントは groups 内にユーザーのグループ情報も返します。これらから Kanboard グループを作成するには:

  1. Casdoor アプリケーションの OIDC/OAuth タブで、Token group format を Name (group) に設定します。これにより、グループは my-org/developers ではなく developers として受け取られます。
  2. プラグイン設定で、Groups Key を groups に設定します。一部のグループのみを使用する場合は、カンマ区切りで Group Filter にリストします。

Kanboard は、保存された User ID Key の値によって再訪問者を認識し、ユーザー名やメールアドレスでは認識しません。Casdoor ユーザーと同じユーザー名を持つ既存の Kanboard ユーザーは、アカウントがリンクされるまで Casdoor ではサインインできません:

  • ユーザーはパスワードで Kanboard にサインインし、プロフィールの外部アカウントを開いて Link OAuth2 account をクリックします。
  • または、管理者がユーザーの認証設定にある OAuth2 ID フィールドに、Casdoor ユーザー ID(sub 値)を入力します。

結果の確認​

  1. プライベートブラウザウィンドウで Kanboard を開きます。サインインページに OAuth2 login が表示されます。
  2. それをクリックして Casdoor にサインインします。Casdoor ユーザーとしてログインした状態で Kanboard が開かれます。

トラブルシューティング​

SymptomCause and fix
Kanboard shows External authentication failedThe user isn't linked yet and Allow Account Creation is off, or a Kanboard user with the same username exists. Turn on account creation, or link the user.
Casdoor shows Redirect URI: ... doesn't exist in the allowed Redirect URI listApplication URL in Kanboard is wrong, often still http://localhost/. Fix it, and add the Callback URL of the plugin to Redirect URLs.
The username, name, or email of new users is emptyScopes lacks profile or email, or the application's Token fields list leaves the fields out. Casdoor returns only the fields in that list from the UserInfo endpoint.
You use https://door.example.com/api/get-account as User API URLThat endpoint returns the user inside data. Use the UserInfo endpoint instead, as shown above.

関連項目​