Skip to content

Commit 5aeb2f1

Browse files
mattleibowCopilot
andauthored
Add .NET 10 MauiBlazorWebIdentity sample (#647)
* Add .NET 10 MauiBlazorWebIdentity sample Copied 9.0/MauiBlazorWebIdentity and upgraded to .NET 10 with: - All TFMs and packages updated to net10.0/10.0.2 - Identity Schema v3 with passkey support (PasskeySubmit, Passkeys, RenamePasskey) - NotFound page with UseStatusCodePagesWithReExecute - ReconnectModal component - All identity pages updated from official .NET 10 template - Cross-platform DB: SQL Server on Windows, SQLite on macOS/Linux - Bootstrap updated to lib/bootstrap/dist/ (full dist from template) - App.razor: ResourcePreloader, ImportMap, @assets refs - Removed IdentityUserAccessor (replaced by RedirectToInvalidUser) - Removed Tizen platform target - Preserved all MAUI client auth behavior unchanged * Rename projects: MauiBlazorWeb → MauiBlazorWebIdentity - Solution: MauiBlazorWebIdentity.sln (was MauiBlazorWeb.sln) - Shared: MauiBlazorWebIdentity.Shared (was MauiBlazorWeb.Shared) - Web: MauiBlazorWebIdentity.Web (was MauiBlazorWeb.Web) - MAUI: MauiBlazorWebIdentity (was MauiBlazorWeb) - Removed unnecessary nested MauiBlazorWeb/ subfolder - All namespaces updated to match - Differentiates from the non-identity 9.0/MauiBlazorWeb sample * Fix MAUI build: restore AddMauiBlazorWebView API name, update package versions - AddMauiBlazorWebView() was incorrectly renamed during global namespace replace - MAUI packages updated to 10.0.10 (actual available version) - Microsoft.Extensions.Logging.Debug set to 10.0.0 * Fix nav and CSS to match .NET 10 template - Add missing 'nav' CSS class to <nav> element in both Web and MAUI NavMenu.razor - Update MAUI MainLayout.razor.css: add 'color-scheme: light only;' - Update MAUI NavMenu.razor.css: height -> min-height * Simplify to SQLite only Remove conditional SQL Server/SQLite logic — this is a sample app, no need for cross-platform DB complexity. SQLite works everywhere. * Fix 401 on logout: use DefaultChallengeScheme pattern from 9.0 AddIdentityApiEndpoints sets DefaultScheme to BearerAndApplicationScheme (composite scheme for both bearer tokens and cookies). Setting DefaultScheme to ApplicationScheme overrides this and breaks API auth for MAUI clients. Instead, only override DefaultChallengeScheme to ApplicationScheme (cookie), which redirects to /Account/Login on auth challenge while preserving the composite scheme for authentication. This matches the documented pattern from MS Learn for MAUI Blazor Hybrid + Identity apps. * Fix NotFound page to use MainLayout for both Web and MAUI - Move NotFound.razor from Shared to Web project with @layout MainLayout so UseStatusCodePagesWithReExecute renders it with the sidebar/nav - Create MAUI-specific NotFound.razor with @layout MainLayout since Router's NotFoundPage renders outside <Found> (no DefaultLayout) - Update both Routes.razor to reference their local NotFound pages - Remove Shared NotFound.razor to avoid ambiguous route matching * Fix MAUI login styling, SecureStorage entitlements, and Remember Me - Style MAUI Login.razor to match web login (form-floating, btn-lg) - Add Remember Me checkbox with conditional token persistence - Add keychain-access-groups entitlement for Mac Catalyst SecureStorage - Extract TokenStorage.DeserializeToken for memory-only token path * Fix edge-to-edge safe area handling for Android and iOS Make safe area CSS rules universal instead of iOS-only (@supports -webkit-touch-callout). This enables proper safe area handling on Android 15+ (API 35+) which enforces edge-to-edge rendering, causing the app content to render behind the status bar. Changes: - Remove @supports (-webkit-touch-callout: none) wrapper so safe area rules apply to both Android and iOS - Change status bar background from #f7f7f7 to rgb(3, 23, 62) to match the sidebar navbar color (gradient start rgb(5,39,103) composited with the top-row overlay rgba(0,0,0,0.4)) - Apply env(safe-area-inset-left) universally for landscape orientation sidebar padding on both platforms See: dotnet/maui#34462 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6dfab40 commit 5aeb2f1

176 files changed

Lines changed: 67007 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

0 commit comments

Comments
 (0)