Перейти к содержимому

Windows logon agent

The OkYouIn Windows agent adds a second factor to the Windows logon screen of servers and PCs: at the console, over Remote Desktop, and on unlock. Windows still checks the password; the agent’s tile then asks OkYouIn for the second factor before the session opens.

The agent is a credential provider and a small service, packaged as one MSI (okyouin-windows-agent-<version>-x64.msi, Authenticode-signed). Each host registers with OkYouIn and pulls its configuration from there; there is nothing to configure on the host beyond the server URL and an enrollment token.

The quick, lab-verified install is in the Windows logon device guide. This page is the reference. For RDP MFA without installing anything on the target hosts, see RD Gateway.

  • Windows Server 2016 or later, or Windows 10 or later, x64.
  • The hosts reach OkYouIn’s public URL over HTTPS (Settings ▸ General). The agent trusts the Windows certificate store; with a self-signed OkYouIn certificate, or a private CA the hosts do not trust, give it a TLS key pin (the Connect tab computes it).
  • The people signing in must exist in OkYouIn with an MFA method — domain users usually synchronized from Active Directory (see Directories). Local Windows accounts are handled by the Local Windows accounts setting.
ProtectedNot protected
Console sign-inNetwork logons: SMB, WinRM / PowerShell remoting, WMI, RPC tools, runas /netonly
Remote Desktop sign-in (with or without NLA)Services and scheduled tasks
Unlock and RDP reconnectUAC and other credential prompts
RDP auto-reconnect

RDP with Restricted Admin or Remote Credential Guard passes no password to the host; the Restricted Admin / Remote Credential Guard setting decides (default Deny: the agent keeps Restricted Admin switched off and logs off such a logon if one still arrives). Smart card and Windows Hello tiles are hidden in protected sign-ins by default, because they would bypass MFA.

The user’s second factor appears on the tile: a code field for TOTP or an e-mailed code, the number to pick for Web Push with number matching, or a wait while the user approves a push or an e-mail link — with Cancel at any time.

A Windows logon application is a protection profile: every host registered with its enrollment token gets the same settings. Servers that need different protection — other exclusions, other offline rules — go into different applications (“Windows servers”, “Finance RDS farm”). There are no per-host settings.

A host is moved between applications from its row on the Hosts tab or on Access ▸ Windows hosts (“Move to another application”): no reinstall, the same identity and break-glass codes; it takes the new settings with its next config pull (within 5 minutes).

Create the application from the Windows logon template (Access ▸ Applications ▸ Add application). Its Connect tab has everything with your values filled in: the MSI download and its SHA-256, the enrollment token, the TLS pin, and the commands below.

The MSI is served by OkYouIn itself, without login:

Terminal window
curl.exe -fsS -o "$env:TEMP\okyouin-windows-agent-0.5.6-x64.msi" "https://mfa.example.com/api/v1/agent/downloads/okyouin-windows-agent-0.5.6-x64.msi"
(Get-FileHash "$env:TEMP\okyouin-windows-agent-0.5.6-x64.msi" -Algorithm SHA256).Hash -eq "<SHA256-FROM-CONNECT-TAB>" # must print True

With a self-signed OkYouIn certificate add -k --pinnedpubkey sha256//<TLS-PIN> to the curl.exe line — the pin is then the trust.

PropertyRequiredMeaning
OKYOUIN_URLFirst installhttps:// + OkYouIn’s public URL
ENROLLMENT_TOKENFirst installThe application’s enrollment token. Hidden from the msiexec command line and the install log; removed from the host after it registered.
TLS_PINSelf-signed certificate onlyOne or more base64 SHA-256 public-key pins, separated by ;

From an elevated prompt, or the same line in SCCM, Intune or any deployment tool:

Terminal window
msiexec /i okyouin-windows-agent-0.5.6-x64.msi /qn /norestart /l*v okyouin-install.log OKYOUIN_URL="https://mfa.example.com" ENROLLMENT_TOKEN="<ENROLLMENT-TOKEN>" TLS_PIN="<TLS-PIN>"

Leave out TLS_PIN when the hosts trust the certificate. Exit codes: 0 done, 3010 done with a reboot pending (the agent works before the reboot), 1603 failed and rolled back — a malformed URL, token or pin fails the install on purpose. A well-formed but wrong token installs; the host then keeps retrying the registration and protects nothing until it succeeds.

The host registers with the enrollment token and appears on the application’s Hosts tab and on Access ▸ Windows hosts:

  • With Approve new hosts automatically on (the default) it is Active at once.
  • With it off, it waits as Pending until you approve it — Approve all pending handles a mass rollout. This is the safer choice: anyone with the token can register a host that can send pushes.

Rotate the enrollment token after a rollout. Hosts already registered keep working.

The Hosts tab shows for each host: status, domain, OS build, agent version (flagged Outdated below the minimum version), IP address, last seen, whether the current config is applied, unresolved exclusions, the decisions it took on its own (offline, excluded, break-glass), and recent sign-ins.

  • Upgrade: install the newer MSI over the running agent — no properties needed; the registration, settings and cache are kept. If the logon screen holds the old DLL, Windows replaces it at the next reboot and the new one is used meanwhile.
  • Uninstall: msiexec /x with the product code (the Connect tab has a remote snippet). It removes the agent, its settings, host credential and cache, and puts back Restricted Admin if the agent had turned it off. Then delete the host on the Hosts tab.
  • Changing server, pin or token (0.5.6+): no reinstall — okyouin-agent.exe --set-pin "<old>;<new>", --set-server, --set-enrollment-token - (reads the token from standard input) from an elevated prompt, or the wizard’s Change connection.

Remote Desktop (RDP), Console, Unlock and reconnect — all on by default. At least one must stay on.

No MFA on unlock within (minutes) (0–480, default 0): no second factor when the same user passed MFA on this host (from the same client address) less than N minutes ago. Applies to unlock and RDP reconnect, never to a new sign-in.

Accounts let through without MFA, per sign-in type (RDP, Console, Unlock). Typed the Windows way — DOMAIN\name, .\name (a local account on each host), BUILTIN\name, or a SID — for a user or a group. Each host resolves the names itself, so nested and local groups work and nothing depends on OkYouIn’s directory sync. Names a host cannot resolve show up on the Hosts tab as unresolved exclusions — a typo is visible, not silent.

A new application starts with one exclusion: the built-in local Administrator (RID 500) at the console only, matched by SID on each host (also when renamed) — emergency access through the VM console when OkYouIn is down, without opening RDP to the most-attacked account. Keep, widen or remove it deliberately.

Exclusions work offline and cover accounts OkYouIn does not know (service and local accounts); application rules, by contrast, need OkYouIn online and match OkYouIn users and groups.

A non-excluded local account is refused by default (Deny), because OkYouIn does not know it. MFA as the OkYouIn local user of the same name lets it in after MFA as that OkYouIn user — use it only when the names really belong to the same person.

What a sign-in does when the host cannot reach OkYouIn, separately for RDP sign-in, Console sign-in and Unlock:

OptionBehaviour
DenyRefused (“OkYouIn is unavailable”). Exclusions and break-glass codes still work.
Allow recent MFA users (grace) (default)Allowed only for a user who passed MFA online on this host within Grace (hours since the last MFA on the host) — default 72, 1–720.
AllowAllowed. Anyone who can cut the host off from OkYouIn signs in without MFA.

The Windows password is always checked first: no offline path lets a wrong password in. The defaults keep regular administrators working through an outage without opening the host to a stolen password of someone who never signed in there.

Connect timeout (seconds) (default 5) and Answer timeout (seconds) (default 10) decide how quickly the agent treats OkYouIn as unreachable. A TLS certificate error counts as unreachable; an error answer from OkYouIn is a refusal, never an offline allow.

With Accept break-glass codes on (the default), each host can have one-time codes for when OkYouIn is unreachable:

  1. On the Hosts tab, open the host and Generate break-glass codes. Ten codes are shown once — OkYouIn keeps only their hashes. Print them or store them offline; generating new ones invalidates the unused old ones.

  2. When OkYouIn is unreachable, the tile offers “Use a break-glass code”. The code is typed with or without dashes, works once, and never skips the Windows password.

  3. The use is reported with the host’s next heartbeat (audit and alert), and the code is dropped from the host’s config.

SettingDefaultMeaning
Restricted Admin / Remote Credential GuardDenyAllow lets these RDP logons in without OkYouIn (they carry no password).
Hide other sign-in options (smart card, Windows Hello)OnOff leaves those tiles, which bypass MFA.
Approve new hosts automaticallyOnSee Enrollment and approval.
Enrollment tokenGeneratedRotate after a rollout.

Application rules (Rules tab) turn MFA on or off by group, network, country or time — OkYouIn sees the RDP client’s address as reported by the agent. Behind an RD Gateway the host sees the gateway as the client address.

Global agent settings — config poll and heartbeat intervals, the minimum agent version, and after how many missed heartbeats a host counts as missing — are on Access ▸ Settings ▸ Windows agent.

The agent never covers network logons, so PowerShell remoting, remote registry and msiexec over remoting keep working while the logon screen does not.

SituationDo
Users cannot sign in, OkYouIn is fineCheck the Hosts tab (status, last seen, unresolved exclusions) and the host’s Event Log, source OkYouInAgent.
OkYouIn is downThe offline settings apply; others use a break-glass code.
Turn the agent off on some hosts nowKill switch, below. The next logon screen is plain Windows.
Turn it off everywhereThe same registry value by GPO (Preferences ▸ Windows Settings ▸ Registry), or disable the application in OkYouIn: hosts that can reach OkYouIn stop protecting at their next config pull.
Host does not reach a usable logonSafe Mode at the console (the agent never blocks the fallback), or the offline kill switch from WinRE.
VMRevert the snapshot taken before the install.
Terminal window
Invoke-Command -ComputerName SERVER01 -ScriptBlock {
New-Item -Path 'HKLM:\SOFTWARE\OkYouIn\Agent' -Force | Out-Null
Set-ItemProperty -Path 'HKLM:\SOFTWARE\OkYouIn\Agent' -Name Disabled -Type DWord -Value 1
}

Undo with Remove-ItemProperty -Path 'HKLM:\SOFTWARE\OkYouIn\Agent' -Name Disabled.

  • Installed host: as administrator, & "C:\Program Files\OkYouIn\Agent\okyouin-agent.exe" --diagnose --out C:\Temp\okyouin-diagnostics.txt — read-only; it reports the service state, registration, the last config pull, the last error, and the certificate chain the host actually receives. A pin mismatch while Windows trusts the chain usually means a TLS-inspecting proxy: exclude the OkYouIn URL from inspection.
  • During setup: the wizard’s Save diagnostics… writes a report to the Desktop.
  • Event Log: source OkYouInAgent — for example 1002 registered, 1003 registration refused, 1009 not protecting yet.

None of these contain the enrollment token, the host secret or any password.

Every sign-in — OkYouIn’s answers and the decisions the hosts took on their own — is in Logging ▸ Windows sign-in log.