使用個別使用者帳戶建立 ASP.NET Core 專案的相關文章

ASP.NET Core Identity 包含在 Visual Studio 的專案範本中,具有 [個別使用者帳戶] 選項。

可在 .NET Core CLI (含 -au Individual) 中使用驗證範本:

dotnet new mvc -au Individual
dotnet new webapp -au Individual
dotnet new mvc -au Individual
dotnet new razor -au Individual

請參閱此 GitHub 問題,以取得 Web API 驗證。

無驗證

可在 .NET Core CLI (含 -au 選項) 中指定驗證。 在 Visual Studio 中,[變更驗證] 對話方塊可用於新的 Web 應用程式。 Visual Studio 中新 Web 應用程式的預設值為 [無驗證]

未驗證建立的專案:

  • 不包含用於登入和登出的網頁和 UI。
  • 不包含驗證碼。

Windows 驗證

在 .NET Core CLI (含 -au Windows 選項) 中為新的 Web 應用程式指定 Windows 驗證。 在 Visual Studio 中,[變更驗證] 對話方塊會提供 [Windows 驗證] 選項。

如果選取 [Windows 驗證],系統會將應用程式設定為使用 [Windows 驗證 IIS 模組]。 [Windows 驗證] 適用於內部 Web 網站。

dotnet 新 webapp 驗證選項

下表顯示新 Web 應用程式可使用的驗證選項:

選項 驗證類型 其他資訊連結
不需要驗證。
個人 個別驗證。 Identity on ASP.NET Core 簡介
IndividualB2C 使用 Azure AD B2C 進行雲端裝載的個別驗證。 Azure AD B2C
SingleOrg 適用於單一租用戶的組織驗證。 Entra External ID tenants 也使用 SingleOrg。 Entra ID
MultiOrg 適用於多個租用戶的組織驗證。 Entra ID
Windows Windows 驗證。 Windows 驗證

Visual Studio 新 webapp 驗證選項

下表顯示使用 Visual Studio 建立新 Web 應用程式時可用的驗證選項:

選項 驗證類型 其他資訊連結
無驗證
個別使用者帳戶 / 在應用程式內儲存使用者帳戶 個別驗證 Identity on ASP.NET Core 簡介
個別使用者帳戶/連線至雲端中現有的使用者存放區 使用 Azure AD B2C 的雲端主控個別驗證 Azure AD B2C
公司或學校雲端 / 單一組織 適用於單一租用戶的組織驗證 Azure AD
公司或學校雲端 / 多個組織 適用於多個租用戶的組織驗證 Azure AD
Windows Windows 驗證 Windows 驗證

其他資源

下列文章說明如何使用 ASP.NET Core 範本 (其使用個別使用者帳戶) 中產生的程式碼: