With the Apple Platform SSO Policy, users sign in to their Macs with their Microsoft Entra ID (formerly Azure AD) account, including multifactor authentication, instead of a local password. Swif creates or unlocks the matching local account at sign-in.
This article covers the Entra ID setup. For every setting in the policy, see Apple Platform SSO Policy.
Requirements
Requirement | Details |
Macs | macOS 12 or later, enrolled in Swif |
Entra ID | Permission to create an app registration, such as the Application Administrator or Global Administrator role |
Swif | Permission to create and assign policies |
If FileVault is on: Platform SSO needs Disable automatic login if FileVault is enabled to be on. Apple Platform SSO Policies created since March 2026 include it automatically. If an Apple Login Window Policy is also assigned to the Macs, turn it on there too. See Apple Platform SSO Policy.
Step 1: Create an app registration in Entra ID
Sign in to the Microsoft Entra admin center, and go to Identity > Applications > App registrations.
Click New registration.
Fill in:
Name: A clear name, such as
Swif macOS LoginSupported account types: Accounts in this organizational directory only (single tenant). Multi-tenant also works.
Redirect URI: Platform Web, and
https://127.0.0.1/xcreds. Add it under Web only, not Single-page application or Mobile and desktop applications.
Click Register.
On the app's Overview page, copy:
the Application (client) ID
the Directory (tenant) ID
You'll need both in Swif.
Under API permissions, check that these Microsoft Graph delegated permissions are listed:
openid,profile,email, andoffline_access. Add any that are missing.Create a client secret. Go to Certificates & secrets, click New client secret, choose when it expires, and click Add.
Copy the secret's Value right away. Entra shows it only once. Copy the Value, not the Secret ID.
The client secret is required. Because the redirect URI is registered under Web, Entra ID requires a client secret to finish sign-in. Without one, sign-in stops on Microsoft's "Stay signed in?" page, and never finishes. No error is shown.
Note when the secret expires, and create a new one before then. When it expires, sign-in stops working the same way.
Step 2: Create the policy in Swif
In Swif, go to Device Management > Policies, then select Create new policy > Configure a Policy.
Select Apple Platform SSO Policy.
Enter a clear name, such as
macOS Login – Entra ID.Fill in the fields:
Client ID: Your Application (client) ID - From Step 1
Client Secret: The secret's Value - From Step 1. Required.
Discovery URL:
https://login.microsoftonline.com/{tenantID}/v2.0/.well-known/openid-configuration- Replace{tenantID}with your Directory (tenant) IDRedirect URI:
https://127.0.0.1/xcreds- Must match the app registration exactlyScopes:
openid profile email offline_access-offline_accesslets the menu bar app check the user's sign-in in the background. It doesn't let users sign in offline.Create Admin User: Off, for standard users - Turn on only if new accounts should be administrators
Map First Name:
given_name
Map Last Name:
family_name
Map Full Name:
name- The user's display name, such as "Jane Doe"Map Username:
preferred_username- Becomes the Mac account's short nameMap Full Username:
preferred_username
Save the policy.
Use your tenant ID in the Discovery URL, not common. https://login.microsoftonline.com/common/.well-known/openid-configuration works only if your app registration is multi-tenant. Most app registrations are single-tenant, the default in Entra ID, and with common, sign-in fails with error AADSTS50194. The tenant URL works with both, and lets only users from your own tenant sign in.
Step 3: Assign the policy
Assign the policy to a test Mac, or a small device group, first.
Restart the Mac once the policy is installed.
Once sign-in works as expected, assign the policy to more Macs.
Restart Macs after every policy change. The Microsoft sign-in window keeps its settings until the Mac restarts. If you change the policy, for example to add a new client secret, Macs keep using the old settings until they restart. Refresh in the sign-in window doesn't load the new ones.
What users see
When the Mac starts, users see a Microsoft sign-in window instead of the usual macOS login window.
They sign in with their Microsoft account, and complete multifactor authentication.
Swif creates their Mac account the first time, or unlocks their existing account, and signs them in.
Signing in with Microsoft needs an internet connection. When the Mac is offline, users sign in with their Mac password, at the standard macOS login window.
Users who already have a Mac account: at first sign-in, they should sign in to their existing account, not choose Create New Account. See merging an existing local account.
Troubleshooting
Sign-in stops on "Stay signed in?"
The page shows loading dots, and never finishes. Microsoft accepted the password, but the Mac couldn't finish signing in. Usually:
The client secret is missing, wrong, or expired. Create a new one in Entra ID, paste its Value into the policy's Client Secret, and save.
The Mac hasn't restarted since the policy changed. Restart it, then sign in again.
If it still fails, collect logs, and send them to Swif support. Microsoft's error, such as an AADSTS code, is only logged with detailed logging on, so follow every step in Collect logs for Swif support.
Sign-in fails with "AADSTS50194"
The Discovery URL uses common, but your app registration is single-tenant. Change it to https://login.microsoftonline.com/{tenantID}/v2.0/.well-known/openid-configuration, with your Directory (tenant) ID.
Sign-in fails with a redirect URI error, such as "AADSTS50011"
The Redirect URI in the policy doesn't match the app registration. Use exactly https://127.0.0.1/xcreds in both, with the same spelling and no trailing slash.
Policy changes don't take effect
Restart the Mac. The sign-in window keeps its settings until the Mac restarts.
The Microsoft sign-in window doesn't appear
Check that the policy is installed, in System Settings > General > Device Management.
Restart the Mac.
If FileVault is on, check Disable automatic login if FileVault is enabled. See the note under Requirements.
The Mac account has the wrong name
Change the Map fields to match how you name accounts. For example, use email instead of preferred_username for Map Username.
"Error setting local password to cloud password"
The user's Microsoft password doesn't meet the Mac's password policy, such as the Apple Password Policy's minimum length or complexity. Change the Microsoft password to one that meets the policy, or relax the Mac's password policy.
A user can't sign in when the Mac is offline
Signing in with Microsoft needs an internet connection. When the Mac is offline, the user signs in with their Mac password, at the standard macOS login window. If Disable Switch Login Window Button is on, they can't reach that window. See Require Platform SSO sign-in.
Something else is wrong
Collect Platform SSO logs, and send them to Swif support. See Troubleshooting: Collecting Platform SSO Logs.
Security best practices
Require multifactor authentication in Entra ID for everyone who signs in to Macs.
Create standard accounts. Keep Create Admin User off, unless users need administrator rights.
Rotate the client secret before it expires, then restart Macs, so they use the new one.
Test first, on a small group of Macs, before assigning the policy to everyone.
Related resources
