maui-authentication

Authenticate .NET MAUI users with OAuth 2.0 and Entra ID.

Updated Nov 27, 2025
One-click install
npx skills add https://github.com/seydakaratekeli/KamPay3 --skill maui-authentication-seydakaratekeli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: maui-authentication
Source: https://github.com/seydakaratekeli/KamPay3/tree/main/KamPay/.github/skills/maui-authentication%20-%20Kopyala
Command: npx skills add https://github.com/seydakaratekeli/KamPay3 --skill maui-authentication-seydakaratekeli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Building cross-platform apps often require secure, seamless user authentication across Android, iOS, and Windows, which can be error-prone if implemented ad-hoc.

Core Features & Use Cases

  • WebAuthenticator-based OAuth 2.0 sign-in for generic social providers
  • MSAL.NET integration for Microsoft Entra ID (Azure AD) with broker support
  • Token caching and secure storage, with bearer token delegation for API calls
  • Blazor Hybrid integration guidance to share auth state with Blazor components

Quick Start

Run the sign-in flow in your MAUI app to authenticate a user and fetch tokens.

Frequently Asked Questions about maui-authentication

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement secure authentication in a .NET MAUI app across Android, iOS, and Windows?

Secure authentication in .NET MAUI is facilitated using WebAuthenticator for generic OAuth 2.0 providers and MSAL.NET for Microsoft Entra ID, ensuring consistent cross-platform sign-in. You register an IAuthService via dependency injection to manage the flow.

Can I use MSAL.NET with Microsoft Entra ID and broker support in MAUI?

Yes, MSAL.NET integrates with Microsoft Entra ID in MAUI apps to provide authentication with broker support, enabling secure token caching and seamless sign-in experiences across mobile and desktop platforms.

What is the best way to share authentication state with Blazor Hybrid components in MAUI?

The best way to share authentication state with Blazor Hybrid components is by using a dependency-injected IAuthService and a delegating HTTP handler to pass bearer tokens securely from the native MAUI layer to the Blazor web view.

How do I handle OAuth 2.0 callback URIs and secure token storage in MAUI?

Handling OAuth 2.0 callback URIs in MAUI requires specific platform setup for each OS, while secure token storage is managed through MSAL.NET or WebAuthenticator mechanisms to safely cache credentials and protect bearer tokens.

Do I need a delegating HTTP handler for bearer tokens in MAUI authentication?

Yes, a delegating HTTP handler is required to attach bearer tokens to API calls automatically. It intercepts outgoing HTTP requests in your MAUI app and injects the cached access tokens retrieved by the IAuthService.