Skip to content
This repository has been archived by the owner on Mar 11, 2020. It is now read-only.

Commit

Permalink
v0.1.0.0-Preview2 (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
henalbrod committed Sep 17, 2019
1 parent 7f28e39 commit c3b7944
Show file tree
Hide file tree
Showing 19 changed files with 63 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Blazor-Auth0-ClientSide" Version="1.0.0-Preview1" />
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview8.19405.7" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview8.19405.7" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.0.0-preview8.19405.7" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="3.0.0-preview8.19405.7" PrivateAssets="all" />
<PackageReference Include="Blazor-Auth0-ClientSide" Version="1.0.0-Preview2" />
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview9.19457.4" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview9.19457.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.0.0-preview9.19457.4" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="3.0.0-preview9.19457.4" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Shared\Examples.AspNetCoreHosted.Shared.csproj" />
Expand Down

This file was deleted.

14 changes: 0 additions & 14 deletions examples/Examples.AspNetCoreHosted/Client/Shared/Shell.razor

This file was deleted.

6 changes: 3 additions & 3 deletions examples/Examples.AspNetCoreHosted/Client/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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!!";
Expand Down
3 changes: 3 additions & 0 deletions examples/Examples.AspNetCoreHosted/Client/_Imports.razor
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<LangVersion>7.3</LangVersion>
<UserSecretsId>6c2330d9-84c7-4bf5-80a9-6b48c017bbab</UserSecretsId>
<UserSecretsId>12dacd65-df84-4051-99c4-fbc453d4c470</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.0.0-preview8.19405.7" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="3.0.0-preview8.19405.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0-preview8.19405.7" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.0.0-rc1.19457.4" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="3.0.0-preview9.19457.4" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0-rc1.19457.4" />
</ItemGroup>

<ItemGroup>
Expand Down
41 changes: 16 additions & 25 deletions examples/Examples.ClientSide/App.razor
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
@inject Blazor.Auth0.IAuthenticationService authService
@inject Blazor.Auth0.Models.ClientOptions clientOptions

<CascadingAuthenticationState>

<AuthorizeView>

<Authorized>
<Shell></Shell>
</Authorized>

<NotAuthorized>
@if (authService.SessionState == SessionStates.Undefined || clientOptions.RequireAuthenticatedUser)
{
<p>Determining session state, please wait...</p>
}
else
{
<Shell></Shell>
}
</NotAuthorized>

</AuthorizeView>

</CascadingAuthenticationState>
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
<Authorizing>
<p>>Determining session state, please wait...</p>
</Authorizing>
<NotAuthorized>
<h1>Sorry</h1>
<p>You're not authorized to reach this page. You may need to log in as a different user.</p>
</NotAuthorized>
</AuthorizeRouteView>
</Found>
<NotFound>
<p>Sorry, there's nothing at this address.</p>
</NotFound>
</Router>
10 changes: 5 additions & 5 deletions examples/Examples.ClientSide/Examples.ClientSide.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Blazor-Auth0-ClientSide" Version="1.0.0-Preview1" />
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview8.19405.7" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview8.19405.7" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.0.0-preview8.19405.7" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="3.0.0-preview8.19405.7" PrivateAssets="all" />
<PackageReference Include="Blazor-Auth0-ClientSide" Version="1.0.0-Preview2" />
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview9.19457.4" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview9.19457.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.0.0-preview9.19457.4" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="3.0.0-preview9.19457.4" PrivateAssets="all" />
</ItemGroup>

</Project>
1 change: 0 additions & 1 deletion examples/Examples.ClientSide/Pages/_Imports.razor

This file was deleted.

14 changes: 0 additions & 14 deletions examples/Examples.ClientSide/Shared/Shell.razor

This file was deleted.

6 changes: 3 additions & 3 deletions examples/Examples.ClientSide/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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!!";
Expand Down
3 changes: 3 additions & 0 deletions examples/Examples.ClientSide/_Imports.razor
Original file line number Diff line number Diff line change
@@ -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
Expand Down
41 changes: 16 additions & 25 deletions examples/Examples.ServerSide/App.razor
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
@inject Blazor.Auth0.IAuthenticationService authService
@inject Blazor.Auth0.Models.ClientOptions clientOptions

<CascadingAuthenticationState>

<AuthorizeView>

<Authorized>
<Shell></Shell>
</Authorized>

<NotAuthorized>
@if (authService.SessionState == SessionStates.Undefined || clientOptions.RequireAuthenticatedUser)
{
<p>Determining session state, please wait...</p>
}
else
{
<Shell />
}
</NotAuthorized>

</AuthorizeView>

</CascadingAuthenticationState>
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
<Authorizing>
<p>>Determining session state, please wait...</p>
</Authorizing>
<NotAuthorized>
<h1>Sorry</h1>
<p>You're not authorized to reach this page. You may need to log in as a different user.</p>
</NotAuthorized>
</AuthorizeRouteView>
</Found>
<NotFound>
<p>Sorry, there's nothing at this address.</p>
</NotFound>
</Router>
2 changes: 1 addition & 1 deletion examples/Examples.ServerSide/Examples.ServerSide.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Blazor-Auth0-ServerSide" Version="1.0.0-Preview1" />
<PackageReference Include="Blazor-Auth0-ServerSide" Version="1.0.0-Preview2" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions examples/Examples.ServerSide/Pages/_Host.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
</head>
<body>
<app>
@* Remove the following line of code to disable prerendering *@
@(await Html.RenderStaticComponentAsync<App>())
@(await Html.RenderComponentAsync<App>(RenderMode.ServerPrerendered))
</app>

<script src="_framework/blazor.server.js"></script>
Expand Down
1 change: 0 additions & 1 deletion examples/Examples.ServerSide/Pages/_Imports.razor

This file was deleted.

14 changes: 0 additions & 14 deletions examples/Examples.ServerSide/Shared/Shell.razor

This file was deleted.

2 changes: 1 addition & 1 deletion examples/Examples.ServerSide/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

app.UseEndpoints(endpoints =>
{
endpoints.MapBlazorHub<App>(selector: "app");
endpoints.MapBlazorHub();
endpoints.MapFallbackToPage("/_Host");
});
}
Expand Down
2 changes: 2 additions & 0 deletions examples/Examples.ServerSide/_Imports.razor
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit c3b7944

Please sign in to comment.