Skip to content

Commit 211574f

Browse files
authored
Client Improvization (#19)
* Client Improvization * Little Cleanup & UseUltimateAuthWithAspNetCore Pipeline Method Addition * Improvized Sample Page Seperation & Fix UAuthLoginForm ReturnUrl Behavior * Login Redirect Improvization * Improved UAuthStateManager * Complete AuthStateSnapshot * Complete UAuthState * Add Tests & Fix Current Tests * Minify uauth.js * Last Client Refinement & ProductInfo Improvement
1 parent 3089e8e commit 211574f

File tree

148 files changed

+1874
-964
lines changed

Some content is hidden

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

148 files changed

+1874
-964
lines changed

UltimateAuth.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<Project Path="src/authorization/CodeBeam.UltimateAuth.Authorization.InMemory/CodeBeam.UltimateAuth.Authorization.InMemory.csproj" Id="a1e6d007-bdc0-4574-b549-ec863757edd3" />
1717
<Project Path="src/authorization/CodeBeam.UltimateAuth.Authorization.Reference/CodeBeam.UltimateAuth.Authorization.Reference.csproj" Id="84b784d0-bb48-406a-a0d1-c600da667597" />
1818
<Project Path="src/authorization/CodeBeam.UltimateAuth.Authorization/CodeBeam.UltimateAuth.Authorization.csproj" Id="28b1d647-fb0b-4cc3-8503-2680c4a9b28f" />
19+
<Project Path="src/CodeBeam.UltimateAuth.Client.JsMinifier/CodeBeam.UltimateAuth.Client.JsMinifier.csproj" Id="ef5cfc86-bfd3-4f81-a973-ce7ef58e7525" />
1920
<Project Path="src/CodeBeam.UltimateAuth.Client/CodeBeam.UltimateAuth.Client.csproj" Id="eb60a3b7-ba9d-48c9-98ad-b28e879b23bf" />
2021
<Project Path="src/CodeBeam.UltimateAuth.Core/CodeBeam.UltimateAuth.Core.csproj" />
2122
<Project Path="src/CodeBeam.UltimateAuth.Server/CodeBeam.UltimateAuth.Server.csproj" Id="0a8cdd12-a8c4-4530-87e8-ae778c46322b" />

samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
7-
<Version>0.0.1-preview</Version>
7+
<Version>0.0.1</Version>
88
<BlazorDisableThrowNavigationException>true</BlazorDisableThrowNavigationException>
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="9.0.0-preview.3" />
13-
<PackageReference Include="MudBlazor" Version="9.0.0-preview.1" />
12+
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="9.0.0-rc.1" />
13+
<PackageReference Include="MudBlazor" Version="9.0.0-rc.1" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub/Components/App.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<script src="@Assets["_framework/blazor.web.js"]"></script>
2525
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
2626
<script src="_content/CodeBeam.MudBlazor.Extensions/MudExtensions.min.js"></script>
27-
<script src="_content/CodeBeam.UltimateAuth.Client/uauth.js"></script>
27+
<script src="_content/CodeBeam.UltimateAuth.Client/uauth.min.js"></script>
2828
</body>
2929

3030
</html>

samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub/Components/Pages/Home.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@
3737
</MudText>
3838
return;
3939
}
40-
<UALoginForm Identifier="@_username" Secret="@_password" LoginType="UAuthLoginType.Pkce">
40+
<UAuthLoginForm Identifier="@_username" Secret="@_password" LoginType="UAuthLoginType.Pkce">
4141
<MudStack>
4242
<MudText Typo="Typo.h4">Welcome to UltimateAuth!</MudText>
4343
<MudTextField @bind-Value="@_username" Variant="Variant.Outlined" Label="Username" Immediate="true" HelperText="Default: Admin" />
4444
<MudPasswordField @bind-Value="@_password" Variant="Variant.Outlined" Label="Password" Immediate="true" HelperText="Default: Password!" />
4545
<MudButton Variant="Variant.Filled" Color="Color.Primary" ButtonType="ButtonType.Submit">Login</MudButton>
4646
</MudStack>
47-
</UALoginForm>
47+
</UAuthLoginForm>
4848

4949
<MudStack Class="mud-width-full">
5050
<MudButton Variant="Variant.Filled" Color="Color.Info" OnClick="ProgrammaticPkceLogin">Programmatic Pkce Login</MudButton>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<CascadingAuthenticationState>
1+
<UAuthApp>
22
<Router AppAssembly="typeof(Program).Assembly" NotFoundPage="typeof(Pages.NotFound)">
33
<Found Context="routeData">
44
<AuthorizeRouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)" />
55
<FocusOnNavigate RouteData="routeData" Selector="h1" />
66
</Found>
77
</Router>
8-
</CascadingAuthenticationState>
8+
</UAuthApp>

samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub/Program.cs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
using CodeBeam.UltimateAuth.Authorization.Reference.Extensions;
44
using CodeBeam.UltimateAuth.Client.Extensions;
55
using CodeBeam.UltimateAuth.Core.Domain;
6-
using CodeBeam.UltimateAuth.Core.Extensions;
7-
using CodeBeam.UltimateAuth.Core.Infrastructure;
86
using CodeBeam.UltimateAuth.Core.Runtime;
97
using CodeBeam.UltimateAuth.Credentials.InMemory.Extensions;
108
using CodeBeam.UltimateAuth.Credentials.Reference;
@@ -15,7 +13,6 @@
1513
using CodeBeam.UltimateAuth.Server.Extensions;
1614
using CodeBeam.UltimateAuth.Sessions.InMemory;
1715
using CodeBeam.UltimateAuth.Tokens.InMemory;
18-
using CodeBeam.UltimateAuth.Users;
1916
using CodeBeam.UltimateAuth.Users.InMemory.Extensions;
2017
using CodeBeam.UltimateAuth.Users.Reference;
2118
using CodeBeam.UltimateAuth.Users.Reference.Extensions;
@@ -36,18 +33,16 @@
3633
builder.Services
3734
.AddAuthentication(options =>
3835
{
39-
options.DefaultAuthenticateScheme = UAuthCookieDefaults.AuthenticationScheme;
40-
options.DefaultSignInScheme = UAuthCookieDefaults.AuthenticationScheme;
41-
options.DefaultChallengeScheme = UAuthCookieDefaults.AuthenticationScheme;
36+
options.DefaultAuthenticateScheme = UAuthSchemeDefaults.AuthenticationScheme;
37+
options.DefaultSignInScheme = UAuthSchemeDefaults.AuthenticationScheme;
38+
options.DefaultChallengeScheme = UAuthSchemeDefaults.AuthenticationScheme;
4239
})
4340
.AddUAuthCookies();
4441

4542
builder.Services.AddAuthorization();
4643

4744
builder.Services.AddHttpContextAccessor();
4845

49-
builder.Services.AddUltimateAuth();
50-
5146
builder.Services.AddUltimateAuthServer(o => {
5247
o.Diagnostics.EnableRefreshHeaders = true;
5348
//o.Session.MaxLifetime = TimeSpan.FromSeconds(32);
@@ -110,12 +105,10 @@
110105
app.UseHttpsRedirection();
111106
app.UseCors("WasmSample");
112107

113-
app.UseUltimateAuthServer();
114-
app.UseAuthentication();
115-
app.UseAuthorization();
108+
app.UseUltimateAuthWithAspNetCore();
116109
app.UseAntiforgery();
117110

118-
app.MapUAuthEndpoints();
111+
app.MapUltimateAuthEndpoints();
119112
app.MapStaticAssets();
120113

121114
app.MapControllers();

samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer/CodeBeam.UltimateAuth.Sample.BlazorServer.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
7-
<Version>0.0.1-preview</Version>
7+
<Version>0.0.1</Version>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.1" />
12-
<PackageReference Include="MudBlazor" Version="9.0.0-preview.1" />
13-
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="9.0.0-preview.2" />
11+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.1" />
12+
<PackageReference Include="MudBlazor" Version="9.0.0-rc.1" />
13+
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="9.0.0-rc.1" />
1414
<PackageReference Include="Scalar.AspNetCore" Version="2.12.18" />
1515
</ItemGroup>
1616

samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer/Components/App.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<script src="_framework/blazor.web.js"></script>
2121
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
2222
<script src="_content/CodeBeam.MudBlazor.Extensions/MudExtensions.min.js"></script>
23-
<script src="_content/CodeBeam.UltimateAuth.Client/uauth.js"></script>
23+
<script src="_content/CodeBeam.UltimateAuth.Client/uauth.min.js"></script>
2424
</body>
2525

2626
</html>

samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer/Components/Layout/MainLayout.razor

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
@inherits LayoutComponentBase
22
@inject ISnackbar Snackbar
33

4-
<UAuthClientProvider OnReauthRequired="HandleReauth" />
5-
6-
<MudThemeProvider />
7-
<MudPopoverProvider />
8-
<MudDialogProvider />
9-
<MudSnackbarProvider />
10-
114
@Body
125

136
<div id="blazor-error-ui">

samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer/Components/Layout/MainLayout.razor.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)