NAV Navbar

Logon using RDP

Introduction

The Notakey Credential Provider (NtkCp) is a Windows plugin, which extends the logon UI with a new mechanism, which injects Notakey 2FA in the normal logon scenario.

Technical Summary

NtkCp consists of 2 components:

The credential provider provides a username and password input fields. The provided username is sent to the Notakey API, to request approval on the user’s smartphone.

If the username is not found (i.e. the user does not exist or has not been onboarded on the Notakey server), the login attempt will fail with a message.

If the username is found, and the attempt is denied, the logon attempt will fail with an error.

If the user approves the logon attempt, then the provided username and password are processed as they would normally. If the entered password is incorrect, then the logon attempt will fail with a message.

The CLSID for the credential provider is 77E5F42E-B280-4219-B130-D48BB3932A04.

System Requirements

The credential provider requires .NET v4.5, and a supported version of the Windows operating system.

OS Type Minimum Version
Workstation Windows 8
Server Windows Server 2012

Installation Instructions

Download and run MSI installer package. If installer has been just downloaded, Windows Defender will not allow installation. To resolve this allow running of installer in file properties.

This script will create a new system service (Notakey Windows Credential Service), and register the credential provider in the registry.

Uninstall Instructions

To remove the provider from the system, run uninstaller from “Add or remove programs”. Please remmeber that if you have disabled other ways to authenticate you will need to restore at least one other credential provider.

Upgrade Instructions

Upgrade is performed by installing the newer version over the previous version. If you need to install older version, you will have to uninstall the newer version, as Windows installer will not allow installation of older version. Be sure to back up registry settings before uninstall, as any locally edited registry entries will be removed.

Upgrading to 1.3.7 or later

Versions 1.3.7 and later provide important security fixes and are recommended for all installations. Use the latest version; 1.3.8 replaces 1.3.7.

  1. Install the new version over the existing one. For an unattended installation use msiexec /i NotakeyWcpInstaller-Release-1.3.8.msi /qn /norestart. Settings in the registry are kept.
  2. Restart the computer.
  3. Credentials cached by the earlier version are removed at the first start of the new version. At the next logon with Notakey each user enters the Windows password once and approves the request on the phone. After that, logon needs the phone only, as before. Make sure users know their Windows password before you upgrade computers on which other sign-in options are disabled.
  4. After all computers have been upgraded, replace the API client used by the credential provider:
    1. In the NtkAS dashboard open API clients and create a new client with the same scopes as the current one. Copy the client ID and the secret.
    2. Set the ClientID and ClientSecret registry values on every computer and restart the Notakey Windows Credential Service service (or the computer).
    3. When all computers use the new client, delete the old API client in the dashboard.

Upgrading to 1.4.0 or later

Version 1.4.0 and later install and upgrade without a restart of the computer:

  • Double-click on the MSI: Windows asks for administrator rights (a consent prompt for an administrator, a credentials prompt for a standard user) and installs for all users. Nothing needs to be done in the registry before or after.
  • Unattended: msiexec /i NotakeyWcpInstaller-Release-1.4.0.msi /qn /norestart (recommended command line). The installer never restarts the computer by itself, also without /norestart, and does not ask for a restart. The background service is stopped before its files are replaced and started afterwards, on installation, upgrade and repair. Exit code 3010 means that a file held by another program is replaced at the next restart; nothing is restarted automatically.
  • Settings: all registry values and subkeys (ServiceURL, ServiceID, ClientID, ClientSecret, message and timeout values, Cache, LogonUI, Offline) and the access restriction of the key are kept. The installer only adds OfflineLogonDays = 30 when it is missing (see Signing In Without Connection).
  • What still takes effect later: the logon screen process keeps the credential provider it loaded until the next lock, sign-out or start, so the new credential provider appears at the next lock or sign-out. If another program holds one of the installed files (for example a library loaded by an unrelated program), Windows replaces that file at the next restart and msiexec returns 3010 (restart required); nothing is restarted automatically.

Configuring

Configuring the API Endpoint

After installation, the background service must be configured to connect to the desired Notakey API endpoint.

This is done by provisioning defined registry keys.

Below is an example of configuration in registry editor exported format. You can save the text to file with *.reg extension and provision the registry by importing the text file with regedit.

These keys can also be provisioned by Microsoft Active Directory Group Policy, that allows targeting individual machines in domain.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Notakey]

[HKEY_LOCAL_MACHINE\SOFTWARE\Notakey\WindowsCP]
"ServiceURL"="https://demo.notakey.com/api/"
"ServiceID"="65af8d56-b7d9-49b9-86c6-595dc440d933"
"ClientID"="65af8d56-....-595dc440d933"
"ClientSecret"="mysecret"
"MessageTtlSeconds"=dword:0000001e
"MessageActionTitle"="Winlogin"
"MessageDescription"="Proceed as {0} on server {1}?"
"AuthCreateTimeoutSecs"=dword:00000014
"AuthWaitTimeoutSecs"=dword:0000003c

Description of configuration options

Name Default Description
ServiceURL <none> API endpoint URL. Has to end with /api/
ServiceID <none> Service ID as displayed in NAS dashboard Service -> Settings
ClientID <none> NtkAS API client ID
ClientSecret <none> NtkAS API client secret
MessageTtlSeconds 30 The validity duration of auth request
MessageActionTitle Windows login Title for auth request
MessageDescription Do you wish to authenticate user {0} on computer {1}? The message body of auth request
AuthCreateTimeoutSecs 10 The duration which WCP waits for response from NAS API endpoint for new auth request generation. This value cannot exceed 100 seconds
AuthWaitTimeoutSecs 30 The time during which auth request has to be processed. This value cannot exceed 100 seconds and has to be aligned with MessageTtlSeconds
OfflineLogonDays 30 DWORD. Days since a user’s phone keys were last fetched from the server during which that user can sign in without connection, 1 to 365 (larger values are treated as 365). 0 or missing turns sign-in without connection off. The installer sets 30 on a new installation and on an upgrade, repair or reinstall when the value is missing, and never changes a value that is there (to turn the feature off, set 0; a deleted value comes back as 30 at the next repair). Uninstalling leaves it. See Signing In Without Connection

Disabling Other Ways to Authenticate

Each credential provider on a system can be used on its own. Installing and activating NtkCp does not disable the default ways to authenticate (e.g. via a simple username/password).

To prevent users circumventing the more secure Notakey credential provider, other providers need to be disabled.

To do this:

  • open local Group Policy editor
  • navigate to Computer Configuration -> Administrative Templates -> System -> Logon
  • find the policy Exclude credential providers on the right side
  • right click Exclude credential providers, click Edit, click Enabled and enter all the credential provider identifiers (CLSID) (comma-separated), which are to be excluded during authentication
  • click OK to save the changes.

Non-domain Workstations

If changing group policy is impossible (e.g. if the workstation runs Windows Home edition, or is not a part of a domain), then you can still disable credential providers by editing the registry manually.

The registry key HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows > CurrentVersion > Authentication > Credential Providers lists all the available credential providers on the local system.

Right click on a credential provider’s CLSID (which should be disabled), and add a new DWORD (32-bit) Value with the name Disabled and value 1.

This provider will be excluded from future login screens.

Signing In Without Connection

When the computer cannot reach the Notakey server (a laptop outside the office before the VPN is up, a flight, a lost route to the appliance), a user who has signed in with Notakey on this computer before can still sign in with the phone: the logon screen shows a QR code, the user scans it with the Notakey Authenticator app and types the 8-digit code the app shows, together with the Windows password. No network connection is needed on the computer or on the phone.

The feature is controlled by OfflineLogonDays. The installer sets it to 30 days on a new installation and on an upgrade when the value is missing, and never changes a value that is already there, so a value that you or a policy set (including 0, which turns the feature off) stays as it is. To turn the feature off on all computers, deploy OfflineLogonDays = 0 before or together with the upgrade; a value that is missing is created as 30 again at the next install, upgrade or repair.

The default does no harm where the server does not offer the feature: if the server refuses the phone keys request or does not have the route (HTTP 403 or 404), the background service works online only, as before, pauses the phone keys requests for an hour and writes event 91 with the time the pause ends. The pause ends earlier when the server refuses the service’s API token (after a server restart or upgrade); event 91 then says so. Offline sign-in is offered for a user once a request succeeds. Event 84 is written once per service start where ServiceURL is missing or not https.

What is needed

  • A Notakey Authentication Server whose device keys route accepts a token with the scope urn:notakey:auth: version 6.1.0 or later. With an older server, signing in with Notakey works online as before and no sign-in without connection is offered; nothing needs to be turned off.
  • The usual API client of the credential provider with the scope urn:notakey:auth. The credential provider asks for no other scope, so the API client does not change.
  • ServiceURL must be an https:// address. With http:// sign-in without connection is not available (event 84): the phone keys and the server time are only as trustworthy as the connection they came over.
  • Notakey Authenticator 4.1.5 or later on iOS, 4.1.6 or later on Android (the first versions that read the sign-in QR code).

Nothing has to be set on the computers: the installer writes OfflineLogonDays = 30 when the value is missing. To keep the feature off, deploy OfflineLogonDays = 0 before or together with the upgrade. A value written after the upgrade (0 to turn it off, or another number of days) takes effect at the next start of the background service.

How users are prepared

A user can sign in without connection only on a computer where that user has signed in online with Notakey after the feature was turned on. After an approved online sign-in, and then every 4 hours while a logon or lock screen is shown and the server can be reached (the check runs only then, so a computer that stays signed in is not refreshed), the background service fetches the public keys of the user’s phones (public keys only, nothing secret) and the server’s time, and stores them under HKEY_LOCAL_MACHINE\SOFTWARE\Notakey\WindowsCP\Offline. That key is writable by LocalSystem only.

Users of a disabled service, disabled users and users whose sign-in needs an approver (four-eyes policy) do not get sign-in without connection.

What the user sees

  1. The logon or lock screen shows the usual status line that the server cannot be reached. After the user name is typed, the link Sign in without connection appears if that user is prepared on this computer. For other user names nothing changes. The link is offered on the logon and lock screens only, not in the elevation dialog (User Account Control) or other credential dialogs.
  2. The link shows a QR code in place of the Notakey logo, a field for the code and the password field. Users with more than one phone see Use another phone; the QR code is made for the phone that approved last. Return to start goes back.
  3. The user scans the QR code in the Notakey Authenticator app, confirms with the phone’s biometrics or the app PIN, checks the computer and user name the app shows and types the code (12345678 or 1234 5678) and the Windows password.
  4. The background service checks the code. If it is right, the user name and the password go to Windows, which checks the password as for any logon (for a domain account with the domain controller out of reach: against the cached logon). The background service does not check the password itself and the password is not stored.

A QR code is valid for 2 minutes and for one attempt. After a wrong code, an expired code or a password that Windows refuses, a new QR code is shown. The user name is passed to Windows exactly as typed; type it the same way as for the online sign-in (for a domain account the plain user name, as for the online sign-in; DOMAIN\user is not supported, as online).

Limits

  • Days: a user can sign in without connection for OfflineLogonDays days after that user’s phone keys were last fetched. The days are counted with the later of the computer’s clock and the highest time the service has ever seen, so turning the clock back does not extend them. A computer clock that is more than 5 minutes behind the highest time seen makes the feature unavailable until the clock is right.
  • Wrong codes: the first 4 wrong codes in a row cost nothing. After the 5th and every later wrong code no QR code is issued for that user for a while: 30 seconds after the 5th, 1 minute after the 6th, 5 minutes after the 7th, 15 minutes after the 8th and every later one. The logon screen shows “Too many wrong codes. Try again in N min” (or seconds) and offers a new QR code when the wait is over. There is no permanent block. A correct code, or an approved online sign-in of that user on this computer, clears the count and the wait; the background refresh of the phone keys does not. Count and wait survive restarts, and the wait is measured against the highest time the service has seen, so turning the clock back does not shorten it (a clock set forward ends it early).
  • Phone clock: the app refuses a QR code whose time differs from the phone’s clock by more than a day.
  • Removed phones and users: a phone removed or a user disabled on the server keeps working on a computer that has not reached the server since, until the days run out. Choose OfflineLogonDays with this in mind.

Remote Desktop

Over Remote Desktop the logon screen, and with it the QR code, is drawn by the remote computer and shown in the Remote Desktop window, where it can be scanned from the client’s screen. The remote computer must be the one that cannot reach the Notakey server; the setting and the prepared users are those of the remote computer.

Other credential providers

The feature is part of the Notakey tile only. Other credential providers, and the way they are disabled or allowed (see Disabling Other Ways to Authenticate), are not affected.

Events

The background service writes these events to the Windows Application log (source Notakey WCP):

Id Level When
91 Warning / Information Warning: the server refused the phone keys request or does not have the route, HTTP 403 or 404; preparation is paused until the time given (one event per pause, one hour); online sign-in works as before. Information: the pause ended early because the server refused the API token and a new one was obtained (server restarted or upgraded)
90 Information / Warning Result of fetching a user’s phone keys (devices, fingerprints, ignored devices; user removed after the route’s 404; failure, including a redirect; a 403 or 404 is event 91)
89 Information QR code issued (user, phone fingerprint and model)
88 Information / Warning Code checked (user, result, phone fingerprint)
87 Warning Wait started after a wrong code: the seconds and the number of wrong codes in a row
86 Information Count and wait cleared after an approved online sign-in on this computer
85 Warning The days for a user have run out (once per user per service start)
84 Error Stored state unreadable or not writable, invalid OfflineLogonDays, ServiceURL not https, invalid computer name
83 Warning OfflineLogonDays over 365, 365 used

The code itself is never logged.

Determining Provider CLSID

One way to determine the CLSID of a credential provider, is to authenticate yourself using it.

Then open the Registry Editor, and navigate to HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows > CurrentVersion > Authentication > LogonUI.

There will be a key named LastLoggedOnProvider, which will contain the CLSID value of the provider in question.

You may then use this CLSID to disable this specific provider.

Known Provider CLSIDs (Windows 10)

This is a non-exhaustive reference of credential providers and their respective CLSID values on Windows 10.

Some of these values may be the same on other Windows versions.

Name CLSID
NtkCp {77E5F42E-B280-4219-B130-D48BB3932A04}
Smartcard Reader Selection Provider {1b283861-754f-4022-ad47-a5eaaa618894}
Smartcard WinRT Provider {1ee7337f-85ac-45e2-a23c-37c753209769}
PicturePasswordLogonProvider {2135f72a-90b5-4ed3-a7f1-8bb705ac276a}
GenericProvider {25CBB996-92ED-457e-B28C-4774084BD562}
PasswordProvider {60b78e88-ead8-445c-9cfd-0b87f74ea6cd}
PasswordProvider\LogonPasswordReset {8841d728-1a76-4682-bb6f-a9ea53b4b3ba}
FaceCredentialProvider {8AF662BF-65A0-4D0A-A540-A338A999D36F}
Smartcard Credential Provider {8FD7E19C-3BF7-489B-A72C-846AB3678C96}
Smartcard Pin Provider {94596c7e-3744-41ce-893e-bbf09122f76a}
WinBio Credential Provider {BEC09223-B018-416D-A0AC-523971B639F5}
IrisCredentialProvider {C885AA15-1764-4293-B82A-0586ADD46B35}
PINLogonProvider {cb82ea12-9f71-446d-89e1-8d0924e1256e}
NGC Credential Provider {D6886603-9D2F-4EB2-B667-1971041FA96B}
WLIDCredentialProvider {F8A0B131-5F68-486c-8040-7E8FC3C85BB6}

Network Connectivity

The background service will attempt to connect to its specified Notakey endpoint. By default this is port TCP/443 towards NtkAS management API. Valid SSL scertificate is required for connection to work.

There are no expected inbound connections.

Log Files

The credential provider does not perform any logging.

However, the background service will create log files in the package’s NotakeyBGService folder.

NtkWrapper.err.log

This file will contain information about errors.

NtkWrapper.out.log

This file will contain informational output without errors.

NtkWrapper.wrapper.log

This file contains information regarding service startup / stop.

Status Messages

The logon UI will provide a status message, which reflects the status of the background service.

The status will be re-checked every 10 seconds. Upon failure, the status check interval will become progressively larger (exponential backoff).

Service Status: health-check request timed out. Is the background service running?

This message means that the background service is not running, or there is a permission problem, which blocks the logon UI from communicating with it, using named pipes.

Double-check if the service is started and that it runs as Local System, which is the default. Starting with version 1.3.7 only Local System can use the service pipes, and the logon UI refuses a pipe that was not created by Local System or an administrator.

Service Status: service can not connect to API. Check network connectivity and API parameters.

The background service is operational, but the API endpoint is not reachable.

Double-check network connectivity, firewall rules and the API endpoint URL.

Service Status: API call timed out.

The background service is operational, and the API endpoint was reachable at some point, but not anymore.

Double-check network connectivity, and if the Notakey server can be reached.

Service Status: error (<error message>)

This is a generic error message for unexpected issues.

FAQ

Does NtkCp send the locally entered password to a remote server?

No, only the username is sent to the Notakey API. If using password caching feature, password is encrypted with secure encryption method and the key is stored in NtkAS service user profile and the cypher is stored locally in registry. Encryption key is safely disposed after registration and can be retrieved only after successful authentication session.

Does NtkCp perform any username transormations, before sending it to the Notakey API?

No, the username is sent as-is.

Does NtkCp work with local users or domain users?

NtkCp works with both local and domain users. The entered username must match the username that has been onboarded in the Notakey Dashboard.

Can NtkCp be used in an environment that requires smartcard logon?

No, NtkCp is a proxy for the normal username/password logon method.

Can’t the users choose a different credential method, and sidestep Notakey authentication?

If other credential providers are enabled, the users will be able to use them and sidestep Notakey authentication.

To mitigate this, you can disable other credential providers.

Can users use safe mode to sidestep the Notakey credential provider?

Yes, in safe mode, the Notakey credential provider can be avoided. The system will fallback to the default system credential providers.

Can this be used to protect remote servers?

NtkCp can be used together with Remote Desktop Protocol (RDP).

I have an issue, when Network Level Access (NLA) is enabled

See:

Why am I prompted to authenticate twice (over Remote Desktop Protocol)

This can happen, if Network Level Authentication (NLA) is enabled.

This behavior is by Microsoft’s design, and custom credential providers can not circumvent it. For the rationale, see RDC and Custom Credential Providers on the Windows SDK Team blog.

A workaround is to disable NLA on the client connection, and allow clients without NLA on the server.

For instructions on how to disable NLA, see: How can I turn off Network Level Access for Remote Desktop connections?.

How can I turn off Network Level Access for Remote Desktop connections?

For Hosts

For RD Session Hosts, see this Microsoft Technet article: Configure Network Level Authentication for Remote Desktop Services Connections.

The entry Allow connections only from computers running Remote Desktop with Network Level Authentication must NOT be checked.

Example of the required RDP server settings

For Clients

On Remote Desktop Clients, you need to modify the Remote Desktop connection file (with extension .rdp).

Open this file, and add the following setting:

enablecredsspsupport:i:0

When accessing a remote server, the Notakey login option fails

If Network Level Authentication (NLA) is enabled, then the Remote Desktop Client will present a client-side pre-authentication dialog.

This dialog might display the Notakey option, if:

  • the Notakey Credential Provider is used to log in to the client computer.

If Notakey is not used to access the client computer, the Notakey credential provider should not be present in the NLA pre-authentication dialog box.

NLA prevents client-side credential providers (including Notakey) to comply with NLA - only the built-in password and smartcard credential providers will work.

To enforce Notakey multi-factor authentication in these situations, you have 2 options:

Why is the Notakey logon option missing, when accessing a remote server via RDP?

If Network Level Authentication (NLA) is enabled, users will be prompted locally for either their smartcard, or their username/password credentials.

This is by design and can not be changed.

However, if other credential providers are disabled on the remote server, then after the initial authentication, a second logon UI will be presented, where the user will be able to use the Notakey credential provider.

How to disable display of last logged on user

By default display of last logged on username is enabled. This setting is governed by group policy setting and can be adjusted by editing Group Policy setting “Interactive Logon: Do not display last user name” in your domain or altering Windows Registry entry HKLM > Software > Microsoft > Windows > CurrentVersion > Policies > System > DontDisplayLastUsername REG_DWORD to value 1.