diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Layout/MainLayout.razor.cs b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Layout/MainLayout.razor.cs
deleted file mode 100644
index 1e788a96..00000000
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Layout/MainLayout.razor.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-using CodeBeam.UltimateAuth.Client;
-using CodeBeam.UltimateAuth.Client.Errors;
-using CodeBeam.UltimateAuth.Core.Contracts;
-using CodeBeam.UltimateAuth.Core.Domain;
-using CodeBeam.UltimateAuth.Core.Errors;
-using CodeBeam.UAuth.Sample.IntWasm.Client.Infrastructure;
-using Microsoft.AspNetCore.Components;
-using MudBlazor;
-
-namespace CodeBeam.UAuth.Sample.IntWasm.Client.Layout;
-
-public partial class MainLayout
-{
- [CascadingParameter]
- public UAuthState UAuth { get; set; } = default!;
-
- [CascadingParameter]
- public DarkModeManager DarkModeManager { get; set; } = default!;
-
- private async Task Refresh()
- {
- await UAuthClient.Flows.RefreshAsync();
- }
-
- private async Task Logout()
- {
- await UAuthClient.Flows.LogoutAsync();
- }
-
- private Color GetBadgeColor()
- {
- if (UAuth is null || !UAuth.IsAuthenticated)
- return Color.Error;
-
- if (UAuth.IsStale)
- return Color.Warning;
-
- var state = UAuth.Identity?.SessionState;
-
- if (state is null || state == SessionState.Active)
- return Color.Success;
-
- if (state == SessionState.Invalid)
- return Color.Error;
-
- return Color.Warning;
- }
-
- private void HandleSignInClick()
- {
- var uri = Nav.ToAbsoluteUri(Nav.Uri);
-
- if (uri.AbsolutePath.EndsWith("/login", StringComparison.OrdinalIgnoreCase))
- {
- Nav.NavigateTo("/login?uauth_focus=1", replace: true, forceLoad: true);
- return;
- }
-
- GoToLoginWithReturn();
- }
-
- private async Task Validate()
- {
- try
- {
- var result = await UAuthClient.Flows.ValidateAsync();
-
- if (result.IsValid)
- {
- if (result.Snapshot?.Identity.UserStatus == UserStatus.SelfSuspended)
- {
- Snackbar.Add("Your account is suspended by you.", Severity.Warning);
- return;
- }
- Snackbar.Add($"Session active • Tenant: {result.Snapshot?.Identity?.Tenant.Value} • User: {result.Snapshot?.Identity?.PrimaryUserName}", Severity.Success);
- }
- else
- {
- switch (result.State)
- {
- case SessionState.Expired:
- Snackbar.Add("Session expired. Please sign in again.", Severity.Warning);
- break;
-
- case SessionState.DeviceMismatch:
- Snackbar.Add("Session invalid for this device.", Severity.Error);
- break;
-
- default:
- Snackbar.Add($"Session state: {result.State}", Severity.Error);
- break;
- }
- }
- }
- catch (UAuthTransportException)
- {
- Snackbar.Add("Network error.", Severity.Error);
- }
- catch (UAuthProtocolException)
- {
- Snackbar.Add("Invalid response.", Severity.Error);
- }
- catch (UAuthException ex)
- {
- Snackbar.Add($"UAuth error: {ex.Message}", Severity.Error);
- }
- catch (Exception ex)
- {
- Snackbar.Add($"Unexpected error: {ex.Message}", Severity.Error);
- }
- }
-
- private void GoToLoginWithReturn()
- {
- var uri = Nav.ToAbsoluteUri(Nav.Uri);
-
- if (uri.AbsolutePath.EndsWith("/login", StringComparison.OrdinalIgnoreCase))
- {
- Nav.NavigateTo("/login", replace: true);
- return;
- }
-
- var current = Nav.ToBaseRelativePath(uri.ToString());
- if (string.IsNullOrWhiteSpace(current))
- current = "home";
-
- var returnUrl = Uri.EscapeDataString("/" + current.TrimStart('/'));
- Nav.NavigateTo($"/login?returnUrl={returnUrl}", replace: true);
- }
-}
diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/AuthorizedTestPage.razor b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/AuthorizedTestPage.razor
index 962555ed..0a953043 100644
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/AuthorizedTestPage.razor
+++ b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/AuthorizedTestPage.razor
@@ -1,27 +1,4 @@
@page "/authorized-test"
@attribute [UAuthAuthorize]
-@inherits UAuthPageBase
-
-
-
-
-
- Everything is Ok
-
-
- If you see this section, it means you succesfully logged in.
-
-
-
- Go Home Page
-
-
-
-
-
- UltimateAuth protects this resource based on your session and permissions.
-
-
-
-
\ No newline at end of file
+
diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/Home.razor b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/Home.razor
index 2503b3af..945a4332 100644
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/Home.razor
+++ b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/Home.razor
@@ -1,454 +1,4 @@
@page "/home"
@attribute [UAuthAuthorize]
-@inherits UAuthPageBase
-@inject IUAuthClient UAuthClient
-@inject UAuthClientDiagnostics Diagnostics
-@inject AuthenticationStateProvider AuthStateProvider
-@inject ISnackbar Snackbar
-@inject IDialogService DialogService
-@using System.Security.Claims
-@using CodeBeam.UltimateAuth.Client.Diagnostics
-@using CodeBeam.UltimateAuth.Core.Contracts
-@using CodeBeam.UltimateAuth.Core.Defaults
-@using CodeBeam.UAuth.Sample.IntWasm.Client.Components.Custom
-@using Microsoft.AspNetCore.Authorization
-
-@if (AuthState?.Identity?.UserStatus == UserStatus.SelfSuspended)
-{
-
-
-
- Your account is suspended. Please active it before continue.
-
-
-
- Set Active
- Logout
-
-
-
- return;
-}
-
-@if (AuthState?.Identity?.UserStatus == UserStatus.Suspended)
-{
-
-
-
- Your account is suspended. Please contact with administrator.
-
-
-
- Logout
-
-
-
- return;
-}
-
-
-
-
-
-
-
-
-
-
- Session
-
-
-
-
-
-
- Validate
-
-
-
-
-
- Manual Refresh
-
-
-
-
-
- Logout
-
-
-
-
-
- Account
-
-
-
-
- Manage Sessions
-
-
-
- Manage Profile
-
-
-
- Manage Identifiers
-
-
-
- Manage Credentials
-
-
-
- Suspend | Delete Account
-
-
-
- Admin
-
-
-
-
-
-
-
-
- @if (_showAdminPreview)
- {
-
- Admin operations are shown for preview. Sign in as an Admin to execute them.
-
- }
-
- @if (AuthState?.IsInRole("Admin") == true || _showAdminPreview)
- {
-
-
-
- @* *@
- @* *@
- User Management
- @* *@
-
-
-
-
-
- @* *@
- Role Management
- @* *@
-
-
-
- }
-
-
- Resource Api
-
-
-
-
- Manage Resource
-
-
-
-
-
-
-
-
-
-
-
- @((AuthState?.Identity?.DisplayName ?? "?").Substring(0, Math.Min(2, (AuthState?.Identity?.DisplayName ?? "?").Length)))
-
-
-
- @AuthState?.Identity?.DisplayName
-
- @foreach (var role in AuthState?.Claims?.Roles ?? Enumerable.Empty())
- {
-
- @role
-
- }
-
-
-
-
-
-
-
-
-
- @if (_selectedAuthState == "UAuthState")
- {
-
-
-
-
-
- Tenant
-
- @AuthState?.Identity?.Tenant.Value
-
-
-
-
-
-
-
-
- User Id
-
- @AuthState?.Identity?.UserKey.Value
-
-
-
-
-
-
-
- Authenticated
-
- @(AuthState?.IsAuthenticated == true ? "Yes" : "No")
-
-
-
-
-
-
-
- Session State
-
- @AuthState?.Identity?.SessionState?.ToDescriptionString()
-
-
-
-
-
-
-
- Username
-
- @AuthState?.Identity?.PrimaryUserName
-
-
-
-
-
-
-
- Display Name
-
- @AuthState?.Identity?.DisplayName
-
-
-
-
-
-
-
-
- Email
-
- @AuthState?.Identity?.PrimaryEmail
-
-
-
-
-
- Phone
-
- @AuthState?.Identity?.PrimaryPhone
-
-
-
-
-
-
-
- Authenticated At
-
- @* TODO: Add IUAuthDateTimeFormatter *@
- @FormatLocalTime(AuthState?.Identity?.AuthenticatedAt)
-
-
-
-
-
- Last Validated At
-
- @* TODO: Validation call should update last validated at *@
- @FormatLocalTime(AuthState?.LastValidatedAt)
-
-
- }
- else if (_selectedAuthState == "AspNetCoreState")
- {
-
-
-
-
-
- Authenticated
-
- @(_aspNetCoreState?.Identity?.IsAuthenticated == true ? "Yes" : "No")
-
-
-
-
-
-
-
- User Id
-
- @_aspNetCoreState?.FindFirst(System.Security.Claims.ClaimTypes.NameIdentifier)?.Value
-
-
-
-
-
-
-
- Username
-
- @_aspNetCoreState?.Identity?.Name
-
-
-
-
-
-
-
- Authentication Type
-
- @_aspNetCoreState?.Identity?.AuthenticationType
-
-
-
- }
-
-
-
-
-
-
-
-
- @GetHealthText()
-
-
- Lifecycle
-
-
-
-
-
- Started
- @Diagnostics.StartCount
-
- @if (Diagnostics.StartedAt is not null)
- {
-
-
-
- @FormatRelative(Diagnostics.StartedAt)
-
-
- }
-
-
-
-
- Stopped
- @Diagnostics.StopCount
-
-
-
-
-
- Terminated
- @Diagnostics.TerminatedCount
-
- @if (Diagnostics.TerminatedAt is not null)
- {
-
-
-
-
- @FormatRelative(Diagnostics.TerminatedAt)
-
-
-
- }
-
-
-
-
-
- Refresh Metrics
-
-
-
-
-
-
- Total Attempts
- @Diagnostics.RefreshAttemptCount
-
-
-
-
-
-
- Success
-
- @Diagnostics.RefreshSuccessCount
-
-
-
-
-
- Automatic
- @Diagnostics.AutomaticRefreshCount
-
-
-
-
-
- Manual
- @Diagnostics.ManualRefreshCount
-
-
-
-
-
- Touched/Rotated
- @Diagnostics.RefreshTouchedCount / @Diagnostics.RefreshRotatedCount
-
-
-
-
-
- No-Op
- @Diagnostics.RefreshNoOpCount
-
-
-
-
-
- Reauth Required
- @Diagnostics.RefreshReauthRequiredCount
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/LandingPage.razor b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/LandingPage.razor
index 1e4a9016..a02d91bf 100644
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/LandingPage.razor
+++ b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/LandingPage.razor
@@ -1,4 +1,3 @@
@page "/"
-@inject NavigationManager Nav
-@inject AuthenticationStateProvider AuthProvider
+
diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/LandingPage.razor.cs b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/LandingPage.razor.cs
deleted file mode 100644
index ac24e527..00000000
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/LandingPage.razor.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using CodeBeam.UltimateAuth.Core.Defaults;
-
-namespace CodeBeam.UAuth.Sample.IntWasm.Client.Pages;
-
-public partial class LandingPage
-{
- protected override async Task OnAfterRenderAsync(bool firstRender)
- {
- if (!firstRender)
- return;
-
- var state = await AuthProvider.GetAuthenticationStateAsync();
- var isAuthenticated = state.User.Identity?.IsAuthenticated == true;
-
- Nav.NavigateTo(isAuthenticated ? "/home" : $"{UAuthConstants.Routes.LoginRedirect}?fresh=true");
- }
-}
diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/Login.razor b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/Login.razor
index 43e409a7..12aa98c8 100644
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/Login.razor
+++ b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/Login.razor
@@ -1,135 +1,4 @@
@page "/login"
-@using CodeBeam.UltimateAuth.Client.Runtime
@attribute [UAuthLoginPage]
-@inherits UAuthPageBase
-@implements IDisposable
-@inject IUAuthClient UAuthClient
-@inject ISnackbar Snackbar
-@inject IUAuthClientProductInfoProvider ClientProductInfoProvider
-@inject IDeviceIdProvider DeviceIdProvider
-@inject IDialogService DialogService
-
-
-
-
-
-
-
-
-
- You are already signed in
-
-
- @(state.Identity?.PrimaryUserName?.Substring(0, 2))
-
-
-
-
- @state.Identity?.PrimaryUserName
-
-
- Roles: @string.Join(", ", state.Claims.Roles)
-
-
-
-
-
-
- Continue
-
-
-
- Switch account
-
-
-
-
- In a production application, users would typically be redirected automatically.
- This screen is shown in the sample to demonstrate session handling behavior.
-
-
-
-
-
-
-
-
-
-
- UltimateAuth
- The Modern Unified Auth Framework for .NET — Reimagined.
-
-
-
-
-
-
- @_productInfo?.ProductName v @_productInfo?.Version
- Client Profile: @_productInfo?.ClientProfile.ToString()
- @_productInfo?.FrameworkDescription
-
-
-
-
-
-
-
-
-
- Sign In
-
-
- Login (PKCE)
-
-
- In blazor WASM client, you shouldn't login directly.
- Instead of use PKCE flow.
- This section only demonstrates that direct login flow is working, but not suggested.
-
-
-
-
-
- Login
- @if (_isLocked)
- {
-
-
-
- Your account is locked.
- Try again in
-
-
- @_remaining.Minutes.ToString("00"):@_remaining.Seconds.ToString("00")
-
-
-
- }
-
-
-
- Default sample users:
- admin/admin (Admin),
- user/user (Standard User)
-
-
-
-
-
- Programmatic Login
- Login programmatically as admin/admin.
-
-
-
-
-
-
- Forgot Password
- Don't have an account? SignUp
-
-
-
-
-
-
+
diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/NotAuthorized.razor b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/NotAuthorized.razor
deleted file mode 100644
index d8eb7138..00000000
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/NotAuthorized.razor
+++ /dev/null
@@ -1,27 +0,0 @@
-@inject NavigationManager Nav
-
-
-
-
-
-
- Access Denied
-
-
- You don’t have permission to view this page.
- If you think this is a mistake, sign in with a different account or request access.
-
-
-
- Sign In
- Go Back
-
-
-
-
-
- UltimateAuth protects this resource based on your session and permissions.
-
-
-
-
diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/Register.razor b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/Register.razor
index 41c7e05b..745143b0 100644
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/Register.razor
+++ b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/Register.razor
@@ -1,61 +1,3 @@
@page "/register"
-@using CodeBeam.UltimateAuth.Client.Runtime
-@inherits UAuthPageBase
-@implements IDisposable
-@inject IUAuthClient UAuthClient
-@inject ISnackbar Snackbar
-@inject IUAuthClientProductInfoProvider ClientProductInfoProvider
-@inject IDeviceIdProvider DeviceIdProvider
-@inject IDialogService DialogService
-
-
-
-
-
-
-
-
-
-
- UltimateAuth
- The Modern Unified Auth Framework for .NET — Reimagined.
-
-
-
-
- @_productInfo?.ProductName v @_productInfo?.Version
- Client Profile: @_productInfo?.ClientProfile.ToString()
- @_productInfo?.FrameworkDescription
-
-
-
-
-
-
-
-
-
-
-
- Register
-
-
-
-
-
-
- Sign Up
-
-
-
-
- Already have an account? SignIn
-
-
-
-
-
-
-
-
+
diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/ResetCredential.razor b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/ResetCredential.razor
index 2623395b..f2c1a536 100644
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/ResetCredential.razor
+++ b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/ResetCredential.razor
@@ -1,18 +1,3 @@
@page "/reset"
-@inherits UAuthPageBase
-@inject IUAuthClient UAuthClient
-@inject ISnackbar Snackbar
-
-
-
-
-
-
-
-
- Change Password
-
-
-
-
\ No newline at end of file
+
diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/ResetCredential.razor.cs b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/ResetCredential.razor.cs
deleted file mode 100644
index 4e8847fe..00000000
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/ResetCredential.razor.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using CodeBeam.UltimateAuth.Credentials.Contracts;
-using MudBlazor;
-
-namespace CodeBeam.UAuth.Sample.IntWasm.Client.Pages;
-
-public partial class ResetCredential
-{
- private MudForm _form = null!;
- private string? _code;
- private string? _newPassword;
- private string? _newPasswordCheck;
-
- private async Task ResetPasswordAsync()
- {
- await _form.ValidateAsync();
- if (!_form.IsValid)
- {
- Snackbar.Add("Please fix the validation errors.", Severity.Error);
- return;
- }
-
- if (_newPassword != _newPasswordCheck)
- {
- Snackbar.Add("Passwords do not match.", Severity.Error);
- return;
- }
-
- if (string.IsNullOrEmpty(_code) || string.IsNullOrEmpty(_newPassword) || string.IsNullOrEmpty(Identifier))
- {
- Snackbar.Add("Missing required information. Please ensure you have a valid reset code and new password.", Severity.Error);
- return;
- }
-
- var request = new CompleteResetCredentialRequest
- {
- ResetToken = _code,
- NewSecret = _newPassword,
- Identifier = Identifier // Coming from UAuthFlowPageBase automatically if begin reset is successful
- };
-
- var result = await UAuthClient.Credentials.CompleteResetAsync(request);
-
- if (result.IsSuccess)
- {
- Snackbar.Add("Credential reset successfully. Please log in with your new password.", Severity.Success);
- Navigation.NavigateTo("/login");
- }
- else
- {
- Snackbar.Add(result.Problem?.Detail ?? result.Problem?.Title ?? "Failed to reset credential. Please try again.", Severity.Error);
- }
- }
-
- private string PasswordMatch(string arg) => _newPassword != arg ? "Passwords don't match" : string.Empty;
-}
diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Program.cs b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Program.cs
index adb7d26a..415c3f67 100644
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Program.cs
+++ b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Program.cs
@@ -1,7 +1,7 @@
-using CodeBeam.UAuth.Sample.IntWasm.Client.Infrastructure;
-using CodeBeam.UAuth.Sample.IntWasm.Client.ResourceApi;
using CodeBeam.UltimateAuth.Client.Blazor.Extensions;
using CodeBeam.UltimateAuth.Core.Domain;
+using CodeBeam.UltimateAuth.Sample.Shared.Infrastructure;
+using CodeBeam.UltimateAuth.Sample.Shared.ResourceApi;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using MudBlazor.Services;
using MudExtensions.Services;
@@ -13,13 +13,13 @@
});
builder.Services.AddMudExtensions();
builder.Services.AddScoped
();
-builder.Services.AddScoped();
+builder.Services.AddScoped();
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
-builder.Services.AddHttpClient("resourceApi", client =>
+builder.Services.AddHttpClient(client =>
{
- client.BaseAddress = new Uri("https://localhost:6122");
+ client.BaseAddress = new Uri("https://localhost:6122"); // EFCore Resource API URL
});
builder.Services.AddUltimateAuthClientBlazor(o =>
diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Routes.razor b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Routes.razor
index e102e257..312137a2 100644
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Routes.razor
+++ b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Routes.razor
@@ -1,73 +1,2 @@
-@using CodeBeam.UAuth.Sample.IntWasm.Client.Pages
-@using CodeBeam.UAuth.Sample.IntWasm.Client.Infrastructure
-@inject ISnackbar Snackbar
-@inject DarkModeManager DarkModeManager
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- @* Advanced: you can fully control routing by providing your own Router *@
- @*
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- *@
-
-
-@code {
- private async Task HandleReauth()
- {
- Snackbar.Add("Reauthentication required. Please log in again.", Severity.Warning);
- }
-
- #region DarkMode
-
- protected override void OnInitialized()
- {
- DarkModeManager.Changed += OnThemeChanged;
- }
-
- private void OnThemeChanged()
- {
- InvokeAsync(StateHasChanged);
- }
-
- protected override async Task OnAfterRenderAsync(bool firstRender)
- {
- if (firstRender)
- {
- await DarkModeManager.InitializeAsync();
- StateHasChanged();
- }
- }
-
- public void Dispose()
- {
- DarkModeManager.Changed -= OnThemeChanged;
- }
-
- #endregion
-}
+
+
\ No newline at end of file
diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/_Imports.razor b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/_Imports.razor
index 6fb3b530..819b9c9e 100644
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/_Imports.razor
+++ b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/_Imports.razor
@@ -15,5 +15,9 @@
@using CodeBeam.UltimateAuth.Client
@using CodeBeam.UltimateAuth.Client.Blazor
+@using CodeBeam.UltimateAuth.Sample.Shared.Components
+@using CodeBeam.UltimateAuth.Sample.Shared.Components.Page
+@using CodeBeam.UltimateAuth.Sample.Shared.Components.Layout
+
@using MudBlazor
@using MudExtensions
diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.csproj b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.csproj
index e03668c9..2154aec8 100644
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.csproj
+++ b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/Components/App.razor b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/Components/App.razor
index 6ba144f0..794bd19e 100644
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/Components/App.razor
+++ b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/Components/App.razor
@@ -9,6 +9,7 @@
+
diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/Program.cs b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/Program.cs
index 7790e14a..10c609ad 100644
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/Program.cs
+++ b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/Program.cs
@@ -1,23 +1,30 @@
-using CodeBeam.UAuth.Sample.IntWasm.Client.Infrastructure;
-using CodeBeam.UAuth.Sample.IntWasm.Client.ResourceApi;
using CodeBeam.UAuth.Sample.IntWasm.Components;
using CodeBeam.UltimateAuth.Client.AspNetCore;
using CodeBeam.UltimateAuth.Client.Blazor;
using CodeBeam.UltimateAuth.Client.Blazor.Extensions;
using CodeBeam.UltimateAuth.Core.Domain;
+using CodeBeam.UltimateAuth.Sample.Shared.Infrastructure;
+using CodeBeam.UltimateAuth.Sample.Shared.ResourceApi;
using MudBlazor.Services;
using MudExtensions.Services;
var builder = WebApplication.CreateBuilder(args);
+# region Essentials & UI & MudBlazor - Extensions
+
builder.Services.AddRazorComponents()
.AddInteractiveWebAssemblyComponents();
builder.Services.AddMudServices(o => {
o.SnackbarConfiguration.PreventDuplicates = false;
});
+
builder.Services.AddMudExtensions();
+builder.Services.AddScoped();
+
+# endregion
+
builder.Services.AddUltimateAuthClientBlazor(o =>
{
o.Endpoints.BasePath = "https://localhost:6112/auth"; // UAuthHub EFCore URL
@@ -26,18 +33,15 @@
o.Pkce.ReturnUrl = "https://localhost:6132/home"; // This application domain + path
});
-builder.Services.AddScoped();
-
builder.Services.AddUltimateAuthAspNetCoreCompatibility();
+
// If you want to use the UltimateAuthClientBlazor without the AspNetCore compatibility layer, you can register the services like this instead:
-// It gives full AspNetCore compatibility but affects performance significantly.
+// It gives full AspNetCore compatibility but decreases performance significantly.
//builder.Services.AddUltimateAuthResourceApi(o => o.UAuthHubBaseUrl = "https://localhost:6112/auth");
-builder.Services.AddScoped();
-
-builder.Services.AddHttpClient("resourceApi", client =>
+builder.Services.AddHttpClient(client =>
{
- client.BaseAddress = new Uri("https://localhost:6122"); // Resource API URL
+ client.BaseAddress = new Uri("https://localhost:6122"); // EFCore Resource API URL
});
var app = builder.Build();
diff --git a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/wwwroot/app.css b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/wwwroot/app.css
index 5b69be65..91f03d8f 100644
--- a/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/wwwroot/app.css
+++ b/samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/wwwroot/app.css
@@ -112,95 +112,3 @@ code {
.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
text-align: start;
}
-
-.uauth-stack {
- min-height: 60vh;
- max-height: calc(100vh - var(--mud-appbar-height));
- width: 30vw;
- min-width: 300px;
-}
-
-.uauth-menu-popover {
- width: 300px;
-}
-
-.uauth-login-paper {
- min-height: 70vh;
-}
-
- .uauth-login-paper.mud-theme-primary {
- background: linear-gradient(145deg, var(--mud-palette-primary), rgba(0, 0, 0, 0.85) );
- color: white;
- }
-
-.uauth-brand-glow {
- filter: drop-shadow(0 0 25px rgba(255,255,255,0.15));
-}
-
-.uauth-logo-slide {
- animation: uauth-logo-float 30s ease-in-out infinite;
-}
-
-.uauth-text-transform-none .mud-button {
- text-transform: none;
-}
-
-.uauth-dialog {
- height: 68vh;
- max-height: 68vh;
- overflow: auto;
-}
-
-.text-secondary {
- color: var(--mud-palette-text-secondary);
-}
-
-.uauth-blur {
- backdrop-filter: blur(10px);
-}
-
-.uauth-blur-slight {
- backdrop-filter: blur(4px);
-}
-
-@keyframes uauth-logo-float {
- 0% {
- transform: translateY(0) rotateY(0);
- }
-
- 10% {
- transform: translateY(0) rotateY(0);
- }
-
- 15% {
- transform: translateY(200px) rotateY(360deg);
- }
-
- 35% {
- transform: translateY(200px) rotateY(360deg);
- }
-
- 40% {
- transform: translateY(200px) rotateY(720deg);
- }
-
- 60% {
- transform: translateY(200px) rotateY(720deg);
- }
-
- 65% {
- transform: translateY(0) rotateY(360deg);
- }
-
- 85% {
- transform: translateY(0) rotateY(360deg);
- }
-
- 90% {
- transform: translateY(0) rotateY(0);
- }
-
- 100% {
- transform: translateY(0) rotateY(0);
- }
-}
diff --git a/samples/resource-api/CodeBeam.UltimateAuth.Sample.ResourceApi.EfCore/CodeBeam.UltimateAuth.Sample.ResourceApi.EfCore.csproj b/samples/resource-api/CodeBeam.UltimateAuth.Sample.ResourceApi.EfCore/CodeBeam.UltimateAuth.Sample.ResourceApi.EfCore.csproj
index 20471edc..cde66c01 100644
--- a/samples/resource-api/CodeBeam.UltimateAuth.Sample.ResourceApi.EfCore/CodeBeam.UltimateAuth.Sample.ResourceApi.EfCore.csproj
+++ b/samples/resource-api/CodeBeam.UltimateAuth.Sample.ResourceApi.EfCore/CodeBeam.UltimateAuth.Sample.ResourceApi.EfCore.csproj
@@ -4,6 +4,7 @@
net10.0
enable
enable
+ false
diff --git a/src/client/CodeBeam.UltimateAuth.Client.AspNetCore/ServiceCollectionExtensions.cs b/src/client/CodeBeam.UltimateAuth.Client.AspNetCore/ServiceCollectionExtensions.cs
index b546b9d5..88381382 100644
--- a/src/client/CodeBeam.UltimateAuth.Client.AspNetCore/ServiceCollectionExtensions.cs
+++ b/src/client/CodeBeam.UltimateAuth.Client.AspNetCore/ServiceCollectionExtensions.cs
@@ -5,12 +5,9 @@ namespace CodeBeam.UltimateAuth.Client.AspNetCore;
public static class UAuthAspNetCoreExtensions
{
- public static IServiceCollection AddUltimateAuthAspNetCoreCompatibility(
- this IServiceCollection services)
+ public static IServiceCollection AddUltimateAuthAspNetCoreCompatibility(this IServiceCollection services)
{
- services.AddAuthentication("UAuth.Noop")
- .AddScheme("UAuth.Noop", _ => { });
-
+ services.AddAuthentication("UAuth.Noop").AddScheme("UAuth.Noop", _ => { });
services.AddAuthorization();
return services;