From c3b7944b920327e18d0fa21b7c544b334b1c2aee Mon Sep 17 00:00:00 2001 From: Henry Alberto Rodrigue Rodriguez Date: Tue, 17 Sep 2019 07:08:06 -0500 Subject: [PATCH] v0.1.0.0-Preview2 (WIP) --- .../Examples.AspNetCoreHosted.Client.csproj | 10 ++--- .../Client/Pages/_Imports.razor | 1 - .../Client/Shared/Shell.razor | 14 ------- .../Client/Startup.cs | 6 +-- .../Client/_Imports.razor | 3 ++ .../Examples.AspNetCoreHosted.Server.csproj | 8 ++-- examples/Examples.ClientSide/App.razor | 41 ++++++++----------- .../Examples.ClientSide.csproj | 10 ++--- .../Examples.ClientSide/Pages/_Imports.razor | 1 - .../Examples.ClientSide/Shared/Shell.razor | 14 ------- examples/Examples.ClientSide/Startup.cs | 6 +-- examples/Examples.ClientSide/_Imports.razor | 3 ++ examples/Examples.ServerSide/App.razor | 41 ++++++++----------- .../Examples.ServerSide.csproj | 2 +- .../Examples.ServerSide/Pages/_Host.cshtml | 3 +- .../Examples.ServerSide/Pages/_Imports.razor | 1 - .../Examples.ServerSide/Shared/Shell.razor | 14 ------- examples/Examples.ServerSide/Startup.cs | 2 +- examples/Examples.ServerSide/_Imports.razor | 2 + 19 files changed, 63 insertions(+), 119 deletions(-) delete mode 100644 examples/Examples.AspNetCoreHosted/Client/Pages/_Imports.razor delete mode 100644 examples/Examples.AspNetCoreHosted/Client/Shared/Shell.razor delete mode 100644 examples/Examples.ClientSide/Pages/_Imports.razor delete mode 100644 examples/Examples.ClientSide/Shared/Shell.razor delete mode 100644 examples/Examples.ServerSide/Pages/_Imports.razor delete mode 100644 examples/Examples.ServerSide/Shared/Shell.razor diff --git a/examples/Examples.AspNetCoreHosted/Client/Examples.AspNetCoreHosted.Client.csproj b/examples/Examples.AspNetCoreHosted/Client/Examples.AspNetCoreHosted.Client.csproj index 9364b5a..880b8ab 100644 --- a/examples/Examples.AspNetCoreHosted/Client/Examples.AspNetCoreHosted.Client.csproj +++ b/examples/Examples.AspNetCoreHosted/Client/Examples.AspNetCoreHosted.Client.csproj @@ -8,11 +8,11 @@ - - - - - + + + + + diff --git a/examples/Examples.AspNetCoreHosted/Client/Pages/_Imports.razor b/examples/Examples.AspNetCoreHosted/Client/Pages/_Imports.razor deleted file mode 100644 index 0f24eda..0000000 --- a/examples/Examples.AspNetCoreHosted/Client/Pages/_Imports.razor +++ /dev/null @@ -1 +0,0 @@ -@layout MainLayout diff --git a/examples/Examples.AspNetCoreHosted/Client/Shared/Shell.razor b/examples/Examples.AspNetCoreHosted/Client/Shared/Shell.razor deleted file mode 100644 index 406513f..0000000 --- a/examples/Examples.AspNetCoreHosted/Client/Shared/Shell.razor +++ /dev/null @@ -1,14 +0,0 @@ -@inherits LayoutComponentBase - - - -

Sorry, there's nothing at this address.

-
- -

Sorry

-

You're not authorized to reach this page. You may need to log in as a different user.

-
- -

Please wait...

-
-
\ No newline at end of file diff --git a/examples/Examples.AspNetCoreHosted/Client/Startup.cs b/examples/Examples.AspNetCoreHosted/Client/Startup.cs index d5a064d..ae6b603 100644 --- a/examples/Examples.AspNetCoreHosted/Client/Startup.cs +++ b/examples/Examples.AspNetCoreHosted/Client/Startup.cs @@ -11,13 +11,13 @@ public void ConfigureServices(IServiceCollection services) services.AddBlazorAuth0(options => { // Required - options.Domain = "[Auth0_Tenant_Domain]"; + options.Domain = "blazor-auth0.auth0.com"; // Required - options.ClientId = "[Auth0_Client_Id]"; + options.ClientId = "W6zJ2E5noUKYdnNblZh0M8imCCM5WT0z"; //// Required if you want to make use of Auth0's RBAC - options.Audience = "[Auth0_Audience]"; + options.Audience = "https://blazor-auth0-serverside.com"; // PLEASE! PLEASE! PLEASE! DO NOT USE SECRETS IN CLIENT-SIDE APPS... https://medium.com/chingu/protect-application-assets-how-to-secure-your-secrets-a4165550c5fb // options.ClientSecret = "NEVER!!"; diff --git a/examples/Examples.AspNetCoreHosted/Client/_Imports.razor b/examples/Examples.AspNetCoreHosted/Client/_Imports.razor index c9d7717..1375c0f 100644 --- a/examples/Examples.AspNetCoreHosted/Client/_Imports.razor +++ b/examples/Examples.AspNetCoreHosted/Client/_Imports.razor @@ -1,6 +1,9 @@ @using System.Net.Http +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Components.Authorization @using Microsoft.AspNetCore.Components.Forms @using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web @using Microsoft.JSInterop @using Examples.AspNetCoreHosted.Client @using Examples.AspNetCoreHosted.Client.Shared diff --git a/examples/Examples.AspNetCoreHosted/Server/Examples.AspNetCoreHosted.Server.csproj b/examples/Examples.AspNetCoreHosted/Server/Examples.AspNetCoreHosted.Server.csproj index e8d467d..a3416de 100644 --- a/examples/Examples.AspNetCoreHosted/Server/Examples.AspNetCoreHosted.Server.csproj +++ b/examples/Examples.AspNetCoreHosted/Server/Examples.AspNetCoreHosted.Server.csproj @@ -3,13 +3,13 @@ netcoreapp3.0 7.3 - 6c2330d9-84c7-4bf5-80a9-6b48c017bbab + 12dacd65-df84-4051-99c4-fbc453d4c470 - - - + + + diff --git a/examples/Examples.ClientSide/App.razor b/examples/Examples.ClientSide/App.razor index e5aa922..5b52348 100644 --- a/examples/Examples.ClientSide/App.razor +++ b/examples/Examples.ClientSide/App.razor @@ -1,25 +1,16 @@ -@inject Blazor.Auth0.IAuthenticationService authService -@inject Blazor.Auth0.Models.ClientOptions clientOptions - - - - - - - - - - - @if (authService.SessionState == SessionStates.Undefined || clientOptions.RequireAuthenticatedUser) - { -

Determining session state, please wait...

- } - else - { - - } -
- -
- -
\ No newline at end of file + + + + +

>Determining session state, please wait...

+
+ +

Sorry

+

You're not authorized to reach this page. You may need to log in as a different user.

+
+
+
+ +

Sorry, there's nothing at this address.

+
+
\ No newline at end of file diff --git a/examples/Examples.ClientSide/Examples.ClientSide.csproj b/examples/Examples.ClientSide/Examples.ClientSide.csproj index 6fcfe23..85b2674 100644 --- a/examples/Examples.ClientSide/Examples.ClientSide.csproj +++ b/examples/Examples.ClientSide/Examples.ClientSide.csproj @@ -8,11 +8,11 @@ - - - - - + + + + + diff --git a/examples/Examples.ClientSide/Pages/_Imports.razor b/examples/Examples.ClientSide/Pages/_Imports.razor deleted file mode 100644 index 0f24eda..0000000 --- a/examples/Examples.ClientSide/Pages/_Imports.razor +++ /dev/null @@ -1 +0,0 @@ -@layout MainLayout diff --git a/examples/Examples.ClientSide/Shared/Shell.razor b/examples/Examples.ClientSide/Shared/Shell.razor deleted file mode 100644 index 406513f..0000000 --- a/examples/Examples.ClientSide/Shared/Shell.razor +++ /dev/null @@ -1,14 +0,0 @@ -@inherits LayoutComponentBase - - - -

Sorry, there's nothing at this address.

-
- -

Sorry

-

You're not authorized to reach this page. You may need to log in as a different user.

-
- -

Please wait...

-
-
\ No newline at end of file diff --git a/examples/Examples.ClientSide/Startup.cs b/examples/Examples.ClientSide/Startup.cs index ba864af..6bf4475 100644 --- a/examples/Examples.ClientSide/Startup.cs +++ b/examples/Examples.ClientSide/Startup.cs @@ -13,13 +13,13 @@ public void ConfigureServices(IServiceCollection services) services.AddBlazorAuth0(options => { // Required - options.Domain = "[Auth0_Tenant_Domain]"; + options.Domain = "blazor-auth0.auth0.com"; // Required - options.ClientId = "[Auth0_Client_Id]"; + options.ClientId = "Psu6c0Sa4MC1QvdK2OJPONlON8JvaSQt"; //// Required if you want to make use of Auth0's RBAC - options.Audience = "[Auth0_Audience]"; + options.Audience = "https://blazor-auth0-serverside.com"; // PLEASE! PLEASE! PLEASE! DO NOT USE SECRETS IN CLIENT-SIDE APPS... https://medium.com/chingu/protect-application-assets-how-to-secure-your-secrets-a4165550c5fb // options.ClientSecret = "NEVER!!"; diff --git a/examples/Examples.ClientSide/_Imports.razor b/examples/Examples.ClientSide/_Imports.razor index 5a19e1c..8abee15 100644 --- a/examples/Examples.ClientSide/_Imports.razor +++ b/examples/Examples.ClientSide/_Imports.razor @@ -1,6 +1,9 @@ @using System.Net.Http +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Components.Authorization @using Microsoft.AspNetCore.Components.Forms @using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web @using Microsoft.JSInterop @using Examples.ClientSide @using Examples.ClientSide.Shared diff --git a/examples/Examples.ServerSide/App.razor b/examples/Examples.ServerSide/App.razor index b36a239..439d054 100644 --- a/examples/Examples.ServerSide/App.razor +++ b/examples/Examples.ServerSide/App.razor @@ -1,25 +1,16 @@ -@inject Blazor.Auth0.IAuthenticationService authService -@inject Blazor.Auth0.Models.ClientOptions clientOptions - - - - - - - - - - - @if (authService.SessionState == SessionStates.Undefined || clientOptions.RequireAuthenticatedUser) - { -

Determining session state, please wait...

- } - else - { - - } -
- -
- -
\ No newline at end of file + + + + +

>Determining session state, please wait...

+
+ +

Sorry

+

You're not authorized to reach this page. You may need to log in as a different user.

+
+
+
+ +

Sorry, there's nothing at this address.

+
+
\ No newline at end of file diff --git a/examples/Examples.ServerSide/Examples.ServerSide.csproj b/examples/Examples.ServerSide/Examples.ServerSide.csproj index b1e95db..916e399 100644 --- a/examples/Examples.ServerSide/Examples.ServerSide.csproj +++ b/examples/Examples.ServerSide/Examples.ServerSide.csproj @@ -7,7 +7,7 @@ - + diff --git a/examples/Examples.ServerSide/Pages/_Host.cshtml b/examples/Examples.ServerSide/Pages/_Host.cshtml index 057ab05..da5fd7c 100644 --- a/examples/Examples.ServerSide/Pages/_Host.cshtml +++ b/examples/Examples.ServerSide/Pages/_Host.cshtml @@ -14,8 +14,7 @@ - @* Remove the following line of code to disable prerendering *@ - @(await Html.RenderStaticComponentAsync()) + @(await Html.RenderComponentAsync(RenderMode.ServerPrerendered)) diff --git a/examples/Examples.ServerSide/Pages/_Imports.razor b/examples/Examples.ServerSide/Pages/_Imports.razor deleted file mode 100644 index 0f24eda..0000000 --- a/examples/Examples.ServerSide/Pages/_Imports.razor +++ /dev/null @@ -1 +0,0 @@ -@layout MainLayout diff --git a/examples/Examples.ServerSide/Shared/Shell.razor b/examples/Examples.ServerSide/Shared/Shell.razor deleted file mode 100644 index 406513f..0000000 --- a/examples/Examples.ServerSide/Shared/Shell.razor +++ /dev/null @@ -1,14 +0,0 @@ -@inherits LayoutComponentBase - - - -

Sorry, there's nothing at this address.

-
- -

Sorry

-

You're not authorized to reach this page. You may need to log in as a different user.

-
- -

Please wait...

-
-
\ No newline at end of file diff --git a/examples/Examples.ServerSide/Startup.cs b/examples/Examples.ServerSide/Startup.cs index edbd72f..bfa88da 100644 --- a/examples/Examples.ServerSide/Startup.cs +++ b/examples/Examples.ServerSide/Startup.cs @@ -71,7 +71,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseEndpoints(endpoints => { - endpoints.MapBlazorHub(selector: "app"); + endpoints.MapBlazorHub(); endpoints.MapFallbackToPage("/_Host"); }); } diff --git a/examples/Examples.ServerSide/_Imports.razor b/examples/Examples.ServerSide/_Imports.razor index f2746e6..99efec5 100644 --- a/examples/Examples.ServerSide/_Imports.razor +++ b/examples/Examples.ServerSide/_Imports.razor @@ -1,7 +1,9 @@ @using System.Net.Http @using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Components.Authorization @using Microsoft.AspNetCore.Components.Forms @using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web @using Microsoft.JSInterop @using Examples.ServerSide @using Examples.ServerSide.Shared