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.
Requirements
Section titled “Requirements”- 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.
What is and is not protected
Section titled “What is and is not protected”| Protected | Not protected |
|---|---|
| Console sign-in | Network 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 reconnect | UAC 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.
One application = one group of hosts
Section titled “One application = one group of hosts”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).
Install
Section titled “Install”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.
Download and check the MSI
Section titled “Download and check the MSI”The MSI is served by OkYouIn itself, without login:
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 TrueWith a self-signed OkYouIn certificate add -k --pinnedpubkey sha256//<TLS-PIN> to the
curl.exe line — the pin is then the trust.
MSI properties
Section titled “MSI properties”| Property | Required | Meaning |
|---|---|---|
OKYOUIN_URL | First install | https:// + OkYouIn’s public URL |
ENROLLMENT_TOKEN | First install | The application’s enrollment token. Hidden from the msiexec command line and the install log; removed from the host after it registered. |
TLS_PIN | Self-signed certificate only | One 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:
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.
Double-click the MSI. The setup wizard (agent 0.5.6 and later) asks for the three values of the Connect tab — server URL, enrollment token, TLS key pin — and Check connection tests DNS, the connection, the certificate and the token before anything is installed. If OkYouIn cannot be reached, it says why and lets you Install without connection consciously; the agent then protects nothing until it registers.
The wizard is new in 0.5.6 and not verified in our lab yet; the silent install is.
The enrollment token is a secret: never put it in SYSVOL (every domain user can read it) or in a GPO setting.
- Create a share, e.g.
\\fs01\OkYouIn$, readable by Domain Computers only (deployment admins: Modify). Put the MSI andenrollment-token.txt(the token, one line) there. - GPO ▸ Computer Configuration ▸ Policies ▸ Windows Settings ▸ Scripts ▸ Startup ▸ PowerShell Scripts: the “GPO computer startup script” from the Connect tab. It runs as SYSTEM at boot, installs only when the agent is missing or older, and checks the MSI’s SHA-256 first.
- Link the GPO to a pilot OU first.
$share = "\\fs01\OkYouIn$"$msi = Join-Path $share "okyouin-windows-agent-0.5.6-x64.msi"$want = [version]"0.5.6"$have = Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" -ErrorAction SilentlyContinue | Where-Object DisplayName -eq "OkYouIn Windows Agent" | Select-Object -First 1if ($have -and [version]$have.DisplayVersion -ge $want) { return }if ((Get-FileHash $msi -Algorithm SHA256).Hash -ne "<SHA256-FROM-CONNECT-TAB>") { return }$token = (Get-Content (Join-Path $share "enrollment-token.txt") -Raw).Trim()Start-Process msiexec.exe -Wait -ArgumentList "/i `"$msi`" /qn /norestart OKYOUIN_URL=https://mfa.example.com ENROLLMENT_TOKEN=$token"The GPO routes (startup script, or software installation with a transform) are not verified in our lab yet; every step of the startup script is a plain command that is.
Use the silent command line. SCCM: an Application with an MSI deployment type; detect it by
the MSI product code (it changes per version), or by the OkYouInAgent service and the file
version of %ProgramFiles%\OkYouIn\Agent\okyouin-agent.exe. Intune: a Win32 app with the same
command, or a line-of-business MSI app with the properties as arguments. Store the token in
the tool’s protected variables where it has them.
Enrollment and approval
Section titled “Enrollment and approval”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 and uninstall
Section titled “Upgrade and uninstall”- 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 /xwith 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.
Settings
Section titled “Settings”Protected sign-ins
Section titled “Protected sign-ins”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.
Exclusions
Section titled “Exclusions”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.
Local Windows accounts
Section titled “Local Windows accounts”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.
OkYouIn unavailable
Section titled “OkYouIn unavailable”What a sign-in does when the host cannot reach OkYouIn, separately for RDP sign-in, Console sign-in and Unlock:
| Option | Behaviour |
|---|---|
| Deny | Refused (“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. |
| Allow | Allowed. 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.
Break-glass codes
Section titled “Break-glass codes”With Accept break-glass codes on (the default), each host can have one-time codes for when OkYouIn is unreachable:
-
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.
-
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.
-
The use is reported with the host’s next heartbeat (audit and alert), and the code is dropped from the host’s config.
Other settings
Section titled “Other settings”| Setting | Default | Meaning |
|---|---|---|
| Restricted Admin / Remote Credential Guard | Deny | Allow lets these RDP logons in without OkYouIn (they carry no password). |
| Hide other sign-in options (smart card, Windows Hello) | On | Off leaves those tiles, which bypass MFA. |
| Approve new hosts automatically | On | See Enrollment and approval. |
| Enrollment token | Generated | Rotate 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.
Kill switch and recovery
Section titled “Kill switch and recovery”The agent never covers network logons, so PowerShell remoting, remote registry and msiexec
over remoting keep working while the logon screen does not.
| Situation | Do |
|---|---|
| Users cannot sign in, OkYouIn is fine | Check the Hosts tab (status, last seen, unresolved exclusions) and the host’s Event Log, source OkYouInAgent. |
| OkYouIn is down | The offline settings apply; others use a break-glass code. |
| Turn the agent off on some hosts now | Kill switch, below. The next logon screen is plain Windows. |
| Turn it off everywhere | The 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 logon | Safe Mode at the console (the agent never blocks the fallback), or the offline kill switch from WinRE. |
| VM | Revert the snapshot taken before the install. |
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.
From the WinRE command prompt:
reg load HKLM\OFFSW C:\Windows\System32\config\SOFTWAREreg add HKLM\OFFSW\OkYouIn\Agent /v Disabled /t REG_DWORD /d 1 /freg unload HKLM\OFFSWInvoke-Command -ComputerName SERVER01 -ScriptBlock { $app = Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" | Where-Object DisplayName -eq "OkYouIn Windows Agent" | Select-Object -First 1 Start-Process msiexec.exe -Wait -ArgumentList "/x $($app.PSChildName) /qn /norestart"}Diagnostics
Section titled “Diagnostics”- 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.