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

ログイン組織を指定する

ここでは、アプリケーションでログイン組織を指定するオプションを有効にする方法をご紹介します。

例えば、エンドポイント/loginは、ビルトイン組織に属するアカウントのデフォルトのサインインページです。 しかし、ビルトイン組織に属するapp-built-inアプリケーションでログイン組織を指定するオプションを有効にすることができます。 これにより、ユーザーはログイン時に組織を選択できるようになります。 ユーザーが組織を選択した後、/login/<organization>にリダイレクトされます。

Configuration

アプリケーション編集ページでは、Org select mode設定オプションを見つけることができます。 ドロップダウンリストからモードを選択できます。

mode_config

  • None: 組織選択ページは表示されません。
  • 入力:ユーザーは入力ボックスに組織名を入力できます。
  • Select: ユーザーはドロップダウンリストから組織を選択できます。

mode_input

mode_select

情報

組織選択ページは、ルートが/loginまたは<organization>/loginの場合にのみ表示されます。 これは、アプリケーションが組織またはapp-built-inでデフォルトアプリケーションとして設定されていることを意味します。

Automatic Organization Redirect

When a user's session expires, Casdoor remembers which organization they last used and automatically redirects them to that organization's login page. This saves time by eliminating the need to select the organization again after a session timeout.

The organization context is stored in the browser's localStorage when you visit an organization-specific login page (e.g., /login/my-org). When your session expires and you need to log in again, Casdoor automatically redirects you to that same organization's login page instead of the generic /login page.

If no organization context is found in localStorage, you'll be redirected to the default /login page where you can select an organization using the configured mode (Input or Select) if enabled.