# MFA at Windows sign-in

A second factor at the Windows sign-in, verified on the device or by the platform, and what to weigh beforehand.

Requires: Device Identity (DIAM)

> **Add-on required:** MFA at Windows sign-in is part of the **DIAM** (Device Identity) add-on and requires the [endpoint agent](https://dts-identity.com/docs/endpoints/device-client.md) on the endpoint (verification on the device also works with the [legacy client](https://dts-identity.com/docs/endpoints/legacy-client.md)).

A device running the client can demand a second factor at the Windows sign-in and lock screen, on top of the Windows password. This protects the device itself, which is a different boundary from the multi-factor authentication the platform applies to applications.

There are two ways to verify that factor. **On the device** (the default): the user enrolls a factor on each machine, and sign-in works without a network connection. **By the platform** (endpoint agent only): the factor is the one enrolled in the user's account here, one enrollment covers every device, every sign-in is in the audit log, and the machine has to reach the platform. The first is described next, the second under [verified by the platform](#verified-by-the-platform).

> **Plan this rollout with support.** The sign-in component ships with the endpoint agent and is switched on only when MFA is enabled for the device (with the legacy client it is deployed separately). Once active it changes how the machine can be signed into at all. Read the whole page, in particular [before you enable it](#before-you-enable-it), and pilot it on machines you can physically reach.

## How it works

In the default mode the second factor is verified **on the device**, not by the platform:

- The user enters their Windows password as usual. It is validated by Windows first.
- The device then asks for the enrolled second factor: a **FIDO2 security key** (with its PIN, if the key requires one) or a **time-based one-time password** from an authenticator app.
- A user with both enrolled can switch between them at the sign-in screen.

Because verification is local, **sign-in keeps working with no network connection**. The consequence is the other side of the same coin: the platform never sees these sign-ins. There is no central record of them in the [audit log](https://dts-identity.com/docs/monitoring/audit-logs.md), no central list of enrolled factors, and no way to reset a factor from the console.

The sign-in screen is available in English and German. After repeated wrong passwords, the device applies a growing delay.

## Enabling it for a device

MFA enrollment is set per device, in one of three ways: the [device compliance policy](https://dts-identity.com/docs/security/conditional-access/device-compliance-policies.md#windows-logon) in force on the device, a Windows policy, sets it when its **Windows logon** block is switched on (the way to roll it out to a fleet, and the only way to switch a device to platform verification); the **Default MFA for new devices** in the [device settings](https://dts-identity.com/docs/endpoints/device-settings.md#default-mfa-for-new-devices) seeds it when a device joins; and **Configure MFA** on the device page or the equivalent [remote action](https://dts-identity.com/docs/endpoints/remote-actions.md) sets it by hand, as long as no policy governs the device. An offline device gets the change on its next reconnect.

| Setting | Effect on the endpoint |
|---|---|
| **Disabled** | No second factor. The standard Windows sign-in applies. |
| **Optional** | Users who have enrolled a factor are asked for it. Users who have not **continue to sign in with the password alone**, so this protects only the people who opt in. |
| **Required** | A second factor is mandatory. With the endpoint agent, a user with no factor yet signs in with the password and is asked to enroll one in the session. With the legacy client, such a user must enroll one at the sign-in screen before they can continue; there is no skip. |

Use **Optional** to let a pilot group enroll voluntarily, and switch to **Required** only once you know enrollment worked on those machines.

## How users enroll

Enrollment happens on the device, not in a portal:

- **In the agent window** on the endpoint (the **Two-factor sign-in** page; the desktop app with the legacy client), users add or remove an authenticator app and register security keys. This is the normal path, and the one to use before switching a device to **Required**. With the endpoint agent the same is available on the command line (`dts-agent mfa status`, `enroll-totp`, `enroll-security-key`, `unenroll`).
- **Recovery codes** (endpoint agent): eight single-use codes for the day the app or key is not at hand, issued with `dts-agent mfa recovery-codes`. A new set replaces the previous one.
- **At the sign-in screen** (legacy client only), when the device is set to **Required** and the user has no factor yet. The screen shows a QR code for an authenticator app, or prompts for a security key.

Factors are bound to the device. A user with two managed machines enrolls separately on each, and neither the console nor the user portal shows what is enrolled where.

## Before you enable it

Four properties decide whether this feature fits your environment. None of them are edge cases.

- **It replaces every other Windows sign-in method on that device.** While active, Windows Hello PIN, facial recognition, fingerprint, smart card and picture password are suppressed at the sign-in and lock screen. Users who rely on Windows Hello lose it and must be told beforehand.
- **Sign-in depends on the local client service.** If that service is not running on the device, the endpoint agent's sign-in screen waits 30 seconds, then lets the password through under **Optional** and refuses under **Required**; with the legacy client, sign-in at that machine is blocked. Recovery is then a local matter, such as safe mode or another route your desktop team defines, and not something you can fix from the console. Setting the device back to **Disabled** does not help, because that command needs the very component that is down.
- **No help-desk override, one exemption list.** There is no bypass code from the console. The only accounts exempt are the local accounts on the [Windows logon exclusions](https://dts-identity.com/docs/endpoints/device-settings.md#windows-logon-exclusions) under **Device settings** (endpoint agent): they sign in with the password alone, in every mode. Everyone else signing in on that machine is covered.
- **Security keys need current Windows.** On Windows Server 2016 and 2019 the security-key option is not offered; those machines are limited to one-time passwords.

Practical consequence: start on devices you can physically reach, keep a documented local recovery path, and enroll a second factor for at least one administrative account on each pilot machine before switching it to **Required**.

## Verified by the platform [#verified-by-the-platform]

With the endpoint agent, a device policy can switch the devices it governs to **This platform** as the verifier. The second factor is then the one enrolled in the user's account here: a hardware token assigned by an administrator, an authenticator app, or a security key. Nothing is enrolled on the machine, one enrollment covers every device, and users who work at several shared machines enroll once.

This needs endpoint agent **3.0.0 or later**. A device with an older agent is left as it is by such a policy: it keeps its current MFA mode, verified on the device, and the platform does not claim otherwise. It joins the policy with its first report after the agent update.

How a sign-in works in this mode:

1. The user enters the Windows password, which Windows validates as usual.
2. The agent asks the platform who this account is: an account [pinned to the device](https://dts-identity.com/docs/endpoints/remote-actions.md) or a member of one of the policy's **authorized groups** may sign in, nobody else. Membership is checked at every sign-in. A local account of the device signs in only when it is pinned directly: by its name alone it could stand in for anyone in the group.
3. The platform answers what the screen may ask for. The user types the code from the token or app, and the platform verifies it against the same factor as a sign-in to an application, with an attempt budget of the same size but of its own on each computer: wrong codes at the Windows sign-in of one computer do not lock the user out of the applications or of other computers, nor the other way round. Or the user inserts the security key and touches it, entering its PIN where the level demands one, and the platform verifies the key's signature as it does for a browser sign-in with that key.
4. The result is in the [audit log](https://dts-identity.com/docs/monitoring/audit-logs.md), including a refused sign-in and its reason, and an unlock of the lock screen is marked as such.

### Supported factors [#supported-factors]

| Factor in the user's account | With the platform | Without the platform |
|---|---|---|
| Authenticator app (time-based code) | AAL2 | AAL2, on an encrypted disk |
| Hardware token, time-based | AAL2 | AAL2, on an encrypted disk |
| Hardware token, event-based (button counter) | AAL2 | – |
| Security key (USB or NFC), touch only | AAL2 | AAL2 |
| Security key with its PIN | AAL2, phishing-resistant AAL2; AAL3 if hardware-protected | the same levels |
| Temporary access code from the help desk | AAL2, once | – |
| Passkey in a browser or on a phone, Windows Hello | – | – |
| SMS, email, recovery codes, Cisco Duo, privacyIDEA | – | – |

Without the platform means: the policy sets **Logon without the platform** to a number of days, the account is pinned directly to the device, and those days have not run out since the device last received the account's data. A security key works without the platform if it signs with ES256, which most FIDO2 keys do; a key registered with an RSA or EdDSA signature works with the platform only.

### At the sign-in screen [#at-the-sign-in-screen]

After the password, the screen shows what the platform offers for this account:

- a code field, when the account holds a code factor (or an outstanding temporary access code, or an assigned hardware token not activated yet) that reaches the level;
- the code field with a link to use the security key instead, when the account also holds a security key;
- the security key prompt alone, asking for the key's PIN where the level demands it;
- nothing further in **Optional** mode for a user without a factor;
- a refusal with its reason in every other case.

Without the platform, the screen looks the same after a wait of up to about ten seconds, built from what the device holds for this account. Without such data the sign-in is refused, in **Optional** mode as well; accounts on the Windows logon exclusions still sign in with the password alone.

What to know before switching a policy to this mode:

- **The machine must reach the platform.** Without a connection the sign-in is refused for every account except the [Windows logon exclusions](https://dts-identity.com/docs/endpoints/device-settings.md#windows-logon-exclusions), in **Optional** mode as well, because offline nobody knows which accounts are covered. It never falls back to the password alone or to a device-enrolled factor. Keep at least one excluded local administrator account on every device.
- **The tenant's factor settings apply here too.** A factor switched off under [Multi-factor authentication](https://dts-identity.com/docs/security/multi-factor-authentication.md) is neither offered nor accepted at the Windows sign-in, and the offline data of every pinned account is rebuilt without it. When a published policy with **Required** then leaves accounts without any usable factor, the console says so as the factor is switched off, with the number of accounts and the policies: hand out tokens or keys, or switch the factor back on.
- **Signing in without the platform is opt-in per policy.** With **Logon without the platform** set to a number of days instead of **Online sign-in only**, an account pinned directly to the device can still sign in for that many days while the device cannot reach the platform: with its security key, or with its authenticator app or time-based token when the level is AAL2, the device reports every BitLocker volume protected and fully encrypted, and the policy is **assigned to the device directly**. A policy that reaches the device through **All devices** or its conditions is chosen from what the device reports about itself, so it hands out keys only. The device checks such a sign-in itself, against what the platform sent it beforehand, and reports it at its next connection as **Windows Logon Offline** in the audit log, not as a verified MFA. Members of authorized groups have no offline sign-in. **What the device holds is the account's codes for those days**, not the secret behind them, but as good as: anyone with administrator rights on the device can read them, and they are valid everywhere the factor is, in the portal and in every application. Prefer security keys for the offline sign-in; the public part of a key gives nothing away. Accounts with the operator, admin or owner level never get codes, keys only. Unpinning the account, disabling the user or removing the factor withdraws it from the device as soon as the device is connected, and so does turning off the device's disk encryption for the codes. The device page shows per pinned account until when it can sign in offline, and the policy's **Windows logon** tab names the pinned accounts that hold nothing usable offline.
- **Optional is the rollout mode.** Users who already hold a token or app are asked for it; users without one sign in with the password alone and are recorded as such. Switch to **Required** once everyone has a factor. The policy editor names, before you publish, the authorized users who would be locked out.
- **The assurance level** the block demands decides which factors count. Hardware tokens and authenticator apps reach AAL2. A security key reaches AAL2 on its own, the phishing-resistant level only with its PIN, and AAL3 only when it is hardware-protected; the sign-in screen then asks for the PIN.
- **Token not at hand:** an owner or admin can issue a [temporary access code](https://dts-identity.com/docs/security/multi-factor-authentication.md#enrollment-vs-challenge) when the tenant allows them. The user types it into the code field instead of the token's code; it works once, within 60 minutes, and only up to AAL2. It never works without the platform.
- **Hardware token just handed out:** a token an admin assigned and the user has not activated yet is activated by its first code at the Windows sign-in, as at the first sign-in to the portal, when the account holds no other factor at all. With any other factor, the token is activated in the portal. A security key registered by an admin still has to be activated in the portal first.
- **Security keys** are the roaming keys registered in the user's account, such as a USB or NFC key. Windows Hello and passkeys kept in a browser or on a phone cannot answer at the Windows sign-in, and the machine needs a USB port the user can reach.
- **Shared Windows accounts** (several people sign in as `Administrator`) are not supported in this mode: the platform needs to know which person is signing in. Pin one account per person or use the exclusions for the shared one.
- **A separate admin account** (`CORP\max-adm` for Max) is pinned to the person it belongs to: type the Windows account in the pin dialog and choose Max's account. The sign-in then asks for Max's factor. An authorized group cannot do this, as it carries no Windows account name.
- Fast user switching and terminal servers work: every sign-in screen has its own exchange.

### Unlock without a second factor [#unlock-grace]

A user who locks the screen for a coffee is otherwise asked for the second factor again at every unlock. **Unlock without a second factor after a short lock** on the policy's **Windows logon** tab lets the device unlock with the Windows password alone while two limits hold:

- **Lock duration up to**: how long the screen was locked at most, from 1 minute to 1 hour, for example 15 minutes. With **Any duration** only the second limit applies.
- **Second factor again after**: how long after the last second factor in this session an unlock asks for it again, whatever the lock duration, from 15 minutes to 24 hours. With 8 hours (the default), a user gives the second factor about once per working day.

What the setting does not cover, on purpose:

- **Only unlocking the same session.** A new sign-in, a restart, a sign-out and a remote desktop connection always ask for the second factor, and so does an unlock after a wrong password.
- **Only after a second factor.** A session opened with the password alone (in **Optional** mode, or with an excluded account) gets no grace.
- **Not at AAL3.** With that assurance level the section is greyed out and every unlock asks for both factors.
- **It also works without the platform.** The device decides alone; the platform only sends it the two limits with the policy.

Every such unlock is recorded in the [audit log](https://dts-identity.com/docs/monitoring/audit-logs.md) as **Windows Logon Without Second Factor**, with the method `unlock-grace`, and never counts as a verified MFA. A device that cannot reach the platform reports it at its next connection. Disabling a user in this platform does not end a running grace before the second limit runs out; the Windows password is still checked at every unlock. An agent version without this setting keeps asking at every unlock.

## Device lost or compromised with an offline window

The codes already on the device stay valid until its window ends, whatever the platform does afterwards. Unpin the accounts (or delete the device), then let each pinned user enroll their authenticator app anew and replace a hardware token; a security key needs nothing, its secret never left the key.

**Deleting a device** releases its agent first, while the device is connected: the Windows logon MFA is switched off and verified by the device again, and the offline logon data is withdrawn. A device that is not connected cannot be released; the console says so and asks again. Its agent then keeps the current logon mode and the offline data: in platform-verified mode only the accounts on the [Windows logon exclusions](https://dts-identity.com/docs/endpoints/device-settings.md#windows-logon-exclusions) can still sign in, and an administrator from that list can remove the agent on the device. **Replacing** a device withdraws the offline data of the replaced row as soon as it connects.

## Troubleshooting

- **The sign-in screen hangs while connecting.** The local client service is not answering. This is the state described above; resolve it locally on the device.
- **Every sign-in is refused with "not authorized" (platform verification).** The account is neither pinned to the device nor a member of an authorized group, or it is a local account of the device that is not pinned directly, or the policy has no authorized groups and the device no pinned accounts. The audit log entry names the Windows account as the device reported it.
- **Sign-in is refused while the platform is up (platform verification).** Check the audit log for the device: the reason is recorded per attempt. A device that reports a different MFA mode than its policy demands has not received the policy yet; the device page shows what set the current mode.
- **A user has no way to authenticate.** They enrolled on a different machine. Factors do not roam between devices.
- **The security-key option is missing.** Either the operating system does not support it, or the user has only a one-time password enrolled.
- **The setting shows as changed in the console but the device behaves as before.** The device was offline and the command is still queued. Its pending actions are listed on the device page.

## See also

- [Endpoint agent](https://dts-identity.com/docs/endpoints/device-client.md) for the software this feature runs on.
- [Remote actions](https://dts-identity.com/docs/endpoints/remote-actions.md) for setting MFA enrollment, including for offline devices.
- [Device compliance policies](https://dts-identity.com/docs/security/conditional-access/device-compliance-policies.md#windows-logon) for the Windows logon block that sets the mode for a fleet.
- [Device settings](https://dts-identity.com/docs/endpoints/device-settings.md#windows-logon-exclusions) for the fleet-wide sign-in exclusions.
- [Multi-factor authentication](https://dts-identity.com/docs/security/multi-factor-authentication.md) for the factors the platform itself requires when users sign in to applications.
