maui-accessibility
Guide for making .NET MAUI apps accessible — screen reader support via SemanticProperties, heading levels, AutomationProperties…
Add authentication to .NET MAUI apps. Covers WebAuthenticator for generic OAuth 2.0 / social login, and MSAL.NET for Microsoft Entra ID (Azure AD) with broker support (Microsoft Authenticator), token caching, Conditional Access, platform-specific setup (Android, iOS, Windows),
$ npx -y skills add davidortinau/maui-skills --skill maui-authentication --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/maui-authenticationContext preview
The summary Claude sees to decide when to auto-load this skill.
Add authentication to .NET MAUI apps. Covers WebAuthenticator for generic OAuth 2.0 / social login, and MSAL.NET for Microsoft Entra ID (Azure AD) with broker support (Microsoft Authenticator), token caching, Conditional Access, platform-specific setup (Android, iOS, Windows),
name: maui-authentication description: > Add authentication to .NET MAUI apps. Covers WebAuthenticator for generic OAuth 2.0 / social login, and MSAL.NET for Microsoft Entra ID (Azure AD) with broker support (Microsoft Authenticator), token caching, Conditional Access, platform-specific setup (Android, iOS, Windows), DelegatingHandler for bearer token API calls, and Blazor Hybrid integration. USE FOR: "add authentication", "OAuth login", "MSAL.NET", "social login", "WebAuthenticator", "Entra ID MAUI", "Azure AD login", "Google login MAUI", "Apple login MAUI", "token caching", "bearer token", "sign in". DO NOT USE FOR: secure local storage of tokens (use maui-secure-storage), Aspire-specific auth setup (use maui-aspire), or server-side Entra ID provisioning (use entra-id-aspire-provisioning).
> ❌ **Never embed client secrets, API keys, or signing keys in a mobile app binary.** They can be extracted trivially via decompilation.
The correct pattern: 1. App calls `WebAuthenticator` pointing to **your server** endpoint 2. Server initiates the OAuth flow with the identity provider (holds the client secret) 3. Provider redirects back to your server with an auth code 4. Server exchanges the code for tokens and returns them to the app via the callback URI
Windows WebAuthenticator is currently broken. See [dotnet/maui#2702](https://github.com/dotnet/maui/issues/2702). Use MSAL or a WinUI-specific workaround for Windows auth flows.
Apple only returns the user's name and email on the **first** sign-in. Cache them immediately — subsequent sign-ins won't include them.
Set to `true` on iOS 13+ to force a fresh login prompt. When `false` (default), the auth session shares cookies with Safari — the user may be auto-logged in, which can confuse logout/switch-account flows.
The most common auth failure is a URI scheme mismatch. The `CallbackUrl` in code must exactly match:
---
| Criteria | WebAuthenticator | MSAL.NET | |----------|-----------------|----------| | Identity provider | Any OAuth 2.0 / OIDC | Microsoft Entra ID | | Broker support (SSO) | ❌ No | ✅ Microsoft Authenticator, Company Portal | | Conditional Access / MFA | ❌ Manual | ✅ Built-in | | Token cache & refresh | ❌ Manual (SecureStorage) | ✅ Automatic | | Complexity | Simple | More setup | | Use when | Google, Apple, generic OIDC | Entra ID / Azure AD, Microsoft Graph |
---
Forgetting `AuthenticationContinuationHelper.SetAuthenticationContinuationEventArgs` in `MainActivity.OnActivityResult` causes auth to hang silently after the browser returns.
Without `Entitlements.plist` containing keychain group `com.microsoft.adalcache`, token caching fails silently and users are prompted to sign in every time.
When `AcquireTokenSilent` throws `MsalUiRequiredException`, the cached token is expired and interaction is needed. Always fall back to `AcquireTokenInteractive`.
// ❌ Ignoring MsalUiRequiredException — user gets a crash
var result = await _pca.AcquireTokenSilent(scopes, account).ExecuteAsync(ct);
// ✅ Fall back to interactive when silent fails
try
{
result = await _pca.AcquireTokenSilent(scopes, account).ExecuteAsync(ct);
}
catch (MsalUiRequiredException)
{
result = await _pca.AcquireTokenInteractive(scopes).ExecuteAsync(ct);
}// ✅ Don't treat cancellation as an error
catch (MsalClientException ex) when (ex.ErrorCode == "authentication_canceled")
{
return null; // User cancelled — not an error
}In MAUI Blazor Hybrid apps, authentication must happen at the **MAUI layer** (MSAL.NET), not in the Blazor WebView. Don't use `AddMicrosoftIdentityWebApp` or server-side OIDC patterns. Instead: 1. MAUI handles sign-in via `IAuthService` (MSAL.NET) 2. A custom `MsalAuthenticationStateProvider` exposes auth state to Blazor 3. `HttpClient` with `DelegatingHandler` attaches bearer tokens automatically
A collection of 41 skills for .NET MAUI development, UI/UX design reasoning, and Xamarin migration, designed for use with GitHub Copilot CLI and Claude Code.
Guide for making .NET MAUI apps accessible — screen reader support via SemanticProperties, heading levels, AutomationProperties…
.NET MAUI view animations, custom animations, easing functions, rotation, scale, translation, and fade effects. USE FOR: "animate…
.NET MAUI app icon configuration, splash screen setup, SVG to PNG conversion at build time, composed/adaptive icons, and…
.NET MAUI app lifecycle guidance covering the four app states (not running, running, deactivated, stopped), cross-platform Window…
Guide for .NET MAUI apps consuming .NET Aspire-hosted backend services. Covers AppHost configuration, service discovery for…
Guidance for implementing CollectionView in .NET MAUI apps — data display, layouts (list & grid), selection, grouping, scrolling,…