Plugin.Maui.Spine.Authentication.Microsoft
0.1.17
dotnet add package Plugin.Maui.Spine.Authentication.Microsoft --version 0.1.17
NuGet\Install-Package Plugin.Maui.Spine.Authentication.Microsoft -Version 0.1.17
<PackageReference Include="Plugin.Maui.Spine.Authentication.Microsoft" Version="0.1.17" />
<PackageVersion Include="Plugin.Maui.Spine.Authentication.Microsoft" Version="0.1.17" />
<PackageReference Include="Plugin.Maui.Spine.Authentication.Microsoft" />
paket add Plugin.Maui.Spine.Authentication.Microsoft --version 0.1.17
#r "nuget: Plugin.Maui.Spine.Authentication.Microsoft, 0.1.17"
#:package Plugin.Maui.Spine.Authentication.Microsoft@0.1.17
#addin nuget:?package=Plugin.Maui.Spine.Authentication.Microsoft&version=0.1.17
#tool nuget:?package=Plugin.Maui.Spine.Authentication.Microsoft&version=0.1.17
Plugin.Maui.Spine.Authentication.Microsoft
Sign in with Microsoft (personal accounts, work and school accounts) for a Spine app, through MSAL with the broker:
- Microsoft Authenticator or Company Portal on iOS and Android when one is installed, otherwise the system browser.
- WAM on Windows.
- Spine's browser layer on Mac Catalyst, for which MSAL has no build.
dotnet add package Plugin.Maui.Spine.Authentication.Microsoft
Through the Spine server: MSAL's ID token goes to POST {Server}/microsoft/token, like Apple's and Google's.
builder.UseSpine(o => o.AddAuthentication(a =>
{
a.Server = new Uri("https://api.example.com/auth");
a.CallbackScheme = "se.example.app"; // Mac Catalyst
a.AddApple(); // App Store Review Guideline 4.8
a.AddMicrosoft(m => m.ClientId = "…");
}));
On the server: Microsoft(o => { o.ClientId = "…"; o.Tenant = "common"; }).
Without a Spine server: MSAL's own access token goes to an API that Entra protects.
builder.UseSpine(o => o.AddAuthentication(a => a.UseMicrosoft(m =>
{
m.ClientId = "…";
m.Tenant = "contoso.onmicrosoft.com";
m.Scopes.Add("api://orders/access_as_user");
})));
Entra setup
- The app registration. In the Entra admin center: App registrations → New registration. Choose the account types (
Tenantfollows:commonfor any account,organizations,consumers, or one tenant). - Redirect URIs under Authentication → Add a platform → "Mobile and desktop applications", one per platform:
- iOS:
msauth.{bundle id}://auth. - Android:
msauth://{package}/{signature hash}. The hash is the base64 SHA-1 of the key that signs the app:
A Play Store build uses Play App Signing's key. The package computes the hash at run time; Entra needs it registered.keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -storepass android | openssl sha1 -binary | openssl base64 - Windows with WAM:
ms-appx-web://microsoft.aad.brokerplugin/{client id}. - Mac Catalyst:
{CallbackScheme}://callback.
- iOS:
- The app's Info.plist on iOS. The build stops with this list when it is missing (
SpineMicrosoftCheckInfoPlist=falseskips the check):LSApplicationQueriesSchemeswithmsauthv2andmsauthv3;- a
CFBundleURLTypesentry with the schememsauth.{bundle id}.
- Android needs no manifest entries; the package adds MSAL's activity and the
<queries>for the brokers. - With
UseMicrosoft, the API's scopes: an exposed API (api://…/access_as_user), or Microsoft Graph'sUser.Read.
m.UseBroker = false keeps to the system browser everywhere (and WAM off on Windows).
App Store Review Guideline 4.8. With AddMicrosoft, UseSpine throws on iOS and Mac Catalyst without AddApple() (or AppleNotRequired). UseMicrosoft is not checked: it suits apps whose users sign in with their organization's account, which 4.8 exempts. An App Store app that offers personal Microsoft accounts (Tenant = "common" or "consumers") without a Spine server has to answer 4.8 itself.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-android36.0 is compatible. net10.0-ios26.0 is compatible. net10.0-maccatalyst26.0 is compatible. net10.0-windows10.0.19041 is compatible. |
-
net10.0-android36.0
- Microsoft.Identity.Client (>= 4.90.1)
- Microsoft.Maui.Controls (>= 10.0.50)
- Plugin.Maui.Spine.Authentication (>= 0.1.17)
-
net10.0-ios26.0
- Microsoft.Identity.Client (>= 4.90.1)
- Microsoft.Maui.Controls (>= 10.0.50)
- Plugin.Maui.Spine.Authentication (>= 0.1.17)
-
net10.0-maccatalyst26.0
- Microsoft.Identity.Client (>= 4.90.1)
- Microsoft.Maui.Controls (>= 10.0.50)
- Plugin.Maui.Spine.Authentication (>= 0.1.17)
-
net10.0-windows10.0.19041
- Microsoft.Identity.Client (>= 4.90.1)
- Microsoft.Identity.Client.Broker (>= 4.90.1)
- Microsoft.Identity.Client.Extensions.Msal (>= 4.90.1)
- Microsoft.Maui.Controls (>= 10.0.50)
- Plugin.Maui.Spine.Authentication (>= 0.1.17)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.