Skip to content

Commit 615bcdd

Browse files
committed
Add Identity Components to Blazor template
1 parent 0005026 commit 615bcdd

File tree

67 files changed

+3097
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+3097
-25
lines changed

src/ProjectTemplates/ProjectTemplates.slnf

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
"src\\ProjectTemplates\\Web.ItemTemplates\\Microsoft.DotNet.Web.ItemTemplates.csproj",
6666
"src\\ProjectTemplates\\Web.ProjectTemplates\\Microsoft.DotNet.Web.ProjectTemplates.csproj",
6767
"src\\ProjectTemplates\\test\\Templates.Blazor.Tests\\Templates.Blazor.Tests.csproj",
68-
"src\\ProjectTemplates\\test\\Templates.Blazor.WebAssembly.Tests\\Templates.Blazor.WebAssembly.Tests.csproj",
6968
"src\\ProjectTemplates\\test\\Templates.Blazor.WebAssembly.Auth.Tests\\Templates.Blazor.WebAssembly.Auth.Tests.csproj",
69+
"src\\ProjectTemplates\\test\\Templates.Blazor.WebAssembly.Tests\\Templates.Blazor.WebAssembly.Tests.csproj",
7070
"src\\ProjectTemplates\\test\\Templates.Mvc.Tests\\Templates.Mvc.Tests.csproj",
7171
"src\\ProjectTemplates\\test\\Templates.Tests\\Templates.Tests.csproj",
7272
"src\\Razor\\Razor.Runtime\\src\\Microsoft.AspNetCore.Razor.Runtime.csproj",
@@ -95,4 +95,4 @@
9595
"src\\SignalR\\server\\SignalR\\src\\Microsoft.AspNetCore.SignalR.csproj"
9696
]
9797
}
98-
}
98+
}

src/ProjectTemplates/Web.ProjectTemplates/BlazorWeb-CSharp.Client.csproj.in

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="${MicrosoftAspNetCoreComponentsWebAssemblyVersion}" />
15+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="${MicrosoftAspNetCoreComponentsWebAssemblyAuthenticationVersion}" Condition="'$(IndividualLocalAuth)' == 'True'" />
1516
</ItemGroup>
1617

1718
</Project>

src/ProjectTemplates/Web.ProjectTemplates/BlazorWeb-CSharp.csproj.in

+9-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,21 @@
44
<TargetFramework>${DefaultNetCoreTargetFramework}</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
7+
<UserSecretsId Condition="'$(IndividualLocalAuth)' == 'True'">aspnet-BlazorWeb-CSharp-53bc9b9d-9d6a-45d4-8429-2a2761773502</UserSecretsId>
78
<NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
89
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">BlazorWeb-CSharp</RootNamespace>
910
<AssemblyName Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">`$(AssemblyName.Replace(' ', '_'))</AssemblyName>
1011
</PropertyGroup>
11-
<!--#if UseWebAssembly -->
12+
<!--#if (UseWebAssembly || IndividualLocalAuth) -->
1213

1314
<ItemGroup>
14-
<ProjectReference Include="..\BlazorWeb-CSharp.Client\BlazorWeb-CSharp.Client.csproj" />
15-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="${MicrosoftAspNetCoreComponentsWebAssemblyServerVersion}" />
15+
<ProjectReference Include="..\BlazorWeb-CSharp.Client\BlazorWeb-CSharp.Client.csproj" Condition="'$(UseWebAssembly)' == 'True'" />
16+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="${MicrosoftAspNetCoreComponentsWebAssemblyServerVersion}" Condition="'$(UseWebAssembly)' == 'True'" />
17+
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="${MicrosoftAspNetCoreDiagnosticsEntityFrameworkCoreVersion}" Condition="'$(IndividualLocalAuth)' == 'True'" />
18+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="${MicrosoftAspNetCoreIdentityEntityFrameworkCoreVersion}" Condition="'$(IndividualLocalAuth)' == 'True'" />
19+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="${MicrosoftEntityFrameworkCoreSqliteVersion}" Condition="'$(IndividualLocalAuth)' == 'True' AND '$(UseLocalDB)' != 'True'" />
20+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="${MicrosoftEntityFrameworkCoreSqlServerVersion}" Condition="'$(IndividualLocalAuth)' == 'True' AND '$(UseLocalDB)' == 'True'" />
21+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="${MicrosoftEntityFrameworkCoreToolsVersion}" Condition="'$(IndividualLocalAuth)' == 'True'" />
1622
</ItemGroup>
1723
<!--#endif -->
1824

src/ProjectTemplates/Web.ProjectTemplates/RazorPagesWeb-CSharp.csproj.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>${DefaultNetCoreTargetFramework}</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
7-
<UserSecretsId Condition="'$(IndividualAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'">aspnet-Company.WebApplication1-0ce56475-d1db-490f-8af1-a881ea4fcd2d</UserSecretsId>
7+
<UserSecretsId Condition="'$(IndividualAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'">aspnet-Company.WebApplication1-53bc9b9d-9d6a-45d4-8429-2a2761773502</UserSecretsId>
88
<NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
99
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.WebApplication1</RootNamespace>
1010
</PropertyGroup>

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/dotnetcli.host.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
"IncludeSampleContent": {
1818
"isHidden": true
1919
},
20+
"UseLocalDB": {
21+
"longName": "use-local-db"
22+
},
2023
"Framework": {
2124
"longName": "framework"
2225
},
@@ -47,5 +50,8 @@
4750
"longName": "use-program-main",
4851
"shortName": ""
4952
}
50-
}
53+
},
54+
"usageExamples": [
55+
"--use-wasm --auth Individual --use-local-db"
56+
]
5157
}

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/ide.host.json

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
"isVisible": true,
1515
"persistenceScope": "templateGroup"
1616
},
17+
{
18+
"id": "auth",
19+
"isVisible": true,
20+
"defaultValue": "None",
21+
"persistenceScope": "templateGroup"
22+
},
1723
{
1824
"id": "UseProgramMain",
1925
"isVisible": true,

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.cs.json

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "Šablona projektu pro vytvoření webové aplikace Blazor, která podporuje vykreslování na straně serveru i interaktivitu klienta. Tato šablona se dá použít pro webové aplikace s bohatými dynamickými uživatelskými rozhraními (UI).",
55
"symbols/Framework/description": "Cílová architektura pro projekt",
66
"symbols/Framework/choices/net8.0/description": "Cílový net8.0",
7+
"symbols/UserSecretsId/description": "The ID to use for secrets (use with Individual auth).",
78
"symbols/skipRestore/description": "Pokud se tato možnost zadá, přeskočí automatické obnovení projektu při vytvoření.",
89
"symbols/ExcludeLaunchSettings/description": "Určuje, jestli se má z vygenerované šablony vyloučit soubor launchSettings.json.",
910
"symbols/kestrelHttpPort/description": "Číslo portu, který se má použít pro koncový bod HTTP v souboru launchSettings.json.",
@@ -17,6 +18,10 @@
1718
"symbols/IncludeSampleContent/displayName": "_Zahrnout ukázkové stránky",
1819
"symbols/IncludeSampleContent/description": "Nastavuje, jestli se mají přidávat ukázkové stránky a styly pro demonstraci základních vzorů použití.",
1920
"symbols/Empty/description": "Nastavuje, jestli se mají vynechat ukázkové stránky a styly, které demonstrují základní vzory použití.",
21+
"symbols/auth/choices/None/description": "No authentication",
22+
"symbols/auth/choices/Individual/description": "Individual authentication",
23+
"symbols/auth/description": "The type of authentication to use",
24+
"symbols/UseLocalDB/description": "Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual is specified.",
2025
"symbols/NoHttps/description": "Určuje, jestli se má protokol HTTPS vypnout. Tato možnost platí jenom v případě, že se pro --auth nepoužívají Individual, IndividualB2C, SingleOrg ani MultiOrg.",
2126
"symbols/UseProgramMain/displayName": "Nepoužívat _příkazy nejvyšší úrovně",
2227
"symbols/UseProgramMain/description": "Určuje, jestli se má místo příkazů nejvyšší úrovně generovat explicitní třída Program a metoda Main.",

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.de.json

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "Eine Projektvorlage zum Erstellen einer Blazor-Web-App, die sowohl serverseitiges Rendering als auch Clientinteraktivität unterstützt. Diese Vorlage kann für Web-Apps mit umfangreichen dynamischen Benutzeroberflächen (UIs) verwendet werden.",
55
"symbols/Framework/description": "Das Zielframework für das Projekt.",
66
"symbols/Framework/choices/net8.0/description": "Ziel net8.0",
7+
"symbols/UserSecretsId/description": "The ID to use for secrets (use with Individual auth).",
78
"symbols/skipRestore/description": "Wenn angegeben, wird die automatische Wiederherstellung des Projekts beim Erstellen übersprungen.",
89
"symbols/ExcludeLaunchSettings/description": "Ob launchSettings.json aus der generierten Vorlage ausgeschlossen werden soll.",
910
"symbols/kestrelHttpPort/description": "Portnummer, die für den HTTP Endpunkt in launchSettings.json verwendet werden soll.",
@@ -17,6 +18,10 @@
1718
"symbols/IncludeSampleContent/displayName": "_Include Beispielseiten",
1819
"symbols/IncludeSampleContent/description": "Konfiguriert, ob Beispielseiten und Stile hinzugefügt werden, um grundlegende Verwendungsmuster zu veranschaulichen.",
1920
"symbols/Empty/description": "Konfiguriert, ob Beispielseiten und Formatierungen weggelassen werden sollen, die grundlegende Verwendungsmuster veranschaulichen.",
21+
"symbols/auth/choices/None/description": "No authentication",
22+
"symbols/auth/choices/Individual/description": "Individual authentication",
23+
"symbols/auth/description": "The type of authentication to use",
24+
"symbols/UseLocalDB/description": "Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual is specified.",
2025
"symbols/NoHttps/description": "Ob HTTPS deaktiviert werden soll. Diese Option gilt nur, wenn Individual, IndividualB2C, SingleOrg oder MultiOrg nicht für --auth verwendet werden.",
2126
"symbols/UseProgramMain/displayName": "Keine Anweisungen_der obersten Ebene verwenden",
2227
"symbols/UseProgramMain/description": "Gibt an, ob anstelle von Anweisungen der obersten Ebene eine explizite Programmklasse und eine Main-Methode generiert werden soll.",

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.en.json

+8-3
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,25 @@
44
"description": "A project template for creating a Blazor web app that supports both server-side rendering and client interactivity. This template can be used for web apps with rich dynamic user interfaces (UIs).",
55
"symbols/Framework/description": "The target framework for the project.",
66
"symbols/Framework/choices/net8.0/description": "Target net8.0",
7+
"symbols/UserSecretsId/description": "The ID to use for secrets (use with Individual auth).",
78
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
89
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
910
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
10-
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
11+
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if Individual auth is used).",
1112
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
12-
"symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
13+
"symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if Individual auth is used).",
1314
"symbols/UseWebAssembly/displayName": "_Use interactive WebAssembly components",
1415
"symbols/UseWebAssembly/description": "Configures whether to support rendering components interactively in the browser using WebAssembly. The default value is false.",
1516
"symbols/UseServer/displayName": "_Use interactive server components",
1617
"symbols/UseServer/description": "Configures whether to support rendering components interactively on the server via a SignalR WebSocket connection. The default value is true.",
1718
"symbols/IncludeSampleContent/displayName": "_Include sample pages",
1819
"symbols/IncludeSampleContent/description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns.",
1920
"symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.",
20-
"symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
21+
"symbols/auth/choices/None/description": "No authentication",
22+
"symbols/auth/choices/Individual/description": "Individual authentication",
23+
"symbols/auth/description": "The type of authentication to use",
24+
"symbols/UseLocalDB/description": "Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual is specified.",
25+
"symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual isn't used for --auth.",
2126
"symbols/UseProgramMain/displayName": "Do not use _top-level statements",
2227
"symbols/UseProgramMain/description": "Whether to generate an explicit Program class and Main method instead of top-level statements.",
2328
"postActions/restore/description": "Restore NuGet packages required by this project.",

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.es.json

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "Plantilla de proyecto para crear una aplicación web de Blazor que admita tanto la representación del lado del servidor como la interactividad del cliente. Esta plantilla se puede usar para las aplicaciones web con interfaces de usuario dinámicas enriquecidas.",
55
"symbols/Framework/description": "Marco de destino del proyecto.",
66
"symbols/Framework/choices/net8.0/description": "net8.0 de destino",
7+
"symbols/UserSecretsId/description": "The ID to use for secrets (use with Individual auth).",
78
"symbols/skipRestore/description": "Si se especifica, se omite la restauración automática del proyecto durante la creación.",
89
"symbols/ExcludeLaunchSettings/description": "Indica si se va a excluir launchSettings.json de la plantilla generada.",
910
"symbols/kestrelHttpPort/description": "Número de puerto que se va a usar para el punto de conexión HTTP en launchSettings.json.",
@@ -17,6 +18,10 @@
1718
"symbols/IncludeSampleContent/displayName": "_Incluir páginas de ejemplo",
1819
"symbols/IncludeSampleContent/description": "Configura si se van a agregar páginas de ejemplo y estilos para mostrar patrones de uso básicos.",
1920
"symbols/Empty/description": "Configura si se omiten las páginas de ejemplo y los estilos que muestran patrones de uso básicos.",
21+
"symbols/auth/choices/None/description": "No authentication",
22+
"symbols/auth/choices/Individual/description": "Individual authentication",
23+
"symbols/auth/description": "The type of authentication to use",
24+
"symbols/UseLocalDB/description": "Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual is specified.",
2025
"symbols/NoHttps/description": "Si se va a desactivar HTTPS. Esta opción solo se aplica si Individual, IndividualB2C, SingleOrg o MultiOrg no se usan para --auth.",
2126
"symbols/UseProgramMain/displayName": "No usar instrucciones de _nivel superior",
2227
"symbols/UseProgramMain/description": "Indica si se debe generar una clase Program explícita y un método Main en lugar de instrucciones de nivel superior.",

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.fr.json

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "Modèle de projet pour la création d’une application web Blazor qui prend en charge le rendu côté serveur et l’interactivité du client. Ce modèle peut être utilisé pour les applications web avec des interfaces utilisateur dynamiques enrichies.",
55
"symbols/Framework/description": "Framework cible du projet.",
66
"symbols/Framework/choices/net8.0/description": "Cible net8.0",
7+
"symbols/UserSecretsId/description": "The ID to use for secrets (use with Individual auth).",
78
"symbols/skipRestore/description": "S’il est spécifié, ignore la restauration automatique du projet lors de la création.",
89
"symbols/ExcludeLaunchSettings/description": "Indique s’il faut exclure launchSettings.json du modèle généré.",
910
"symbols/kestrelHttpPort/description": "Numéro de port à utiliser pour le point de terminaison HTTP dans launchSettings.json.",
@@ -17,6 +18,10 @@
1718
"symbols/IncludeSampleContent/displayName": "_Inclure des exemples de pages",
1819
"symbols/IncludeSampleContent/description": "Configure s'il faut ajouter des exemples de pages et de style pour illustrer les modèles d'utilisation de base.",
1920
"symbols/Empty/description": "Configure s'il faut omettre les exemples de pages et le style qui illustrent les modèles d'utilisation de base.",
21+
"symbols/auth/choices/None/description": "No authentication",
22+
"symbols/auth/choices/Individual/description": "Individual authentication",
23+
"symbols/auth/description": "The type of authentication to use",
24+
"symbols/UseLocalDB/description": "Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual is specified.",
2025
"symbols/NoHttps/description": "Indique s’il faut désactiver HTTPS. Cette option s’applique uniquement si Individual, IndividualB2C, SingleOrg ou MultiOrg ne sont pas utilisés pour --auth.",
2126
"symbols/UseProgramMain/displayName": "N’utilisez pas _d’instructions de niveau supérieur.",
2227
"symbols/UseProgramMain/description": "Indique s’il faut générer une classe Programme explicite et une méthode Main au lieu d’instructions de niveau supérieur.",

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.it.json

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "Modello di progetto per la creazione di un'app Web Blazor che supporta sia il rendering lato server sia l'interattività client. Questo modello può essere usato per app Web con interfacce utente dinamiche avanzate.",
55
"symbols/Framework/description": "Il framework di destinazione per il progetto.",
66
"symbols/Framework/choices/net8.0/description": "Destinazione net8.0",
7+
"symbols/UserSecretsId/description": "The ID to use for secrets (use with Individual auth).",
78
"symbols/skipRestore/description": "Se specificato, ignora il ripristino automatico del progetto durante la creazione.",
89
"symbols/ExcludeLaunchSettings/description": "Indica se escludere launchSettings.json dal modello generato.",
910
"symbols/kestrelHttpPort/description": "Numero di porta da usare per l'endpoint HTTP in launchSettings.json.",
@@ -17,6 +18,10 @@
1718
"symbols/IncludeSampleContent/displayName": "_Include pagine di esempio",
1819
"symbols/IncludeSampleContent/description": "Consente di configurare se aggiungere pagine di esempio e stile per mostrare modelli di utilizzo di base.",
1920
"symbols/Empty/description": "Consente di configurare se omettere pagine di esempio e stile che mostrano modelli di utilizzo di base.",
21+
"symbols/auth/choices/None/description": "No authentication",
22+
"symbols/auth/choices/Individual/description": "Individual authentication",
23+
"symbols/auth/description": "The type of authentication to use",
24+
"symbols/UseLocalDB/description": "Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual is specified.",
2025
"symbols/NoHttps/description": "Indica se disattivare HTTPS. Questa opzione si applica solo se Individual, IndividualB2C, SingleOrg o MultiOrg non vengono usati per --auth.",
2126
"symbols/UseProgramMain/displayName": "Non usare_istruzioni di primo livello",
2227
"symbols/UseProgramMain/description": "Indica se generare una classe Program esplicita e un metodo Main anziché istruzioni di primo livello.",

0 commit comments

Comments
 (0)