Skip to main content
  1. Fortinet/

FortiAuthenticator Windows Agent Setup Guide

·
Table of Contents

The FortiAuthenticator Agent for Windows allows organizations to enforce multi-factor authentication (MFA) directly at the Windows logon screen. By acting as a credential provider, the agent integrates seamlessly with FortiAuthenticator to validate one-time passwords (OTP) before Windows processes user credentials. This article provides a step-by-step walkthrough of deploying and configuring the Windows Agent in an Active Directory environment, including agent installation, REST API integration, domain and user handling, exemptions, administrative overrides, and enforcement options to securely protect Windows endpoints against unauthorized access.

Topology and Setup
#

Topology for FortiAuthenticator Windows Agent Lab
DeviceIP address
FortiGate port1 (outside)10.255.255.11
FortiGate port2 (inside)10.1.0.1
Windows AD10.1.0.3
Windows Client10.1.0.11
FortiAuthenticator10.255.255.12
FortiToken Cloudftc.fortinet.com
(69.167.109.248)

Both the Windows client and the Windows server with domain services installed belong to the same network, behind FortiGate port2 interface as gateway. The FortiAuthenticator is connected on the same network as FortiGate’s port1 and the WAN Gateway. The FortiToken Cloud service is reachable through this WAN gateway.

The Windows client with hostname “DESKTOP-FSQK1D3” is part of the domain “testlabfound.com” managed by the Windows AD domain controller:

Domain computers added to the Windows AD
Tested using FortiAuthenticator v6.6.1 and FortiAuthenticator Windows Agent v5.2

Pre-requisites
#

The following elements are in place in FortiAuthenticator:

  • FortiAuthenticator’s port1 is configured with 10.255.255.12/24 IP address.
  • Two static routes exist: one default route through the WAN gateway (10.255.255.254), and one route to the internal network through FortiGate port1 (10.255.255.11).
Static routes on FortiAuthenticator
  • The time zone is properly configured and the time is accurate:
Time zone on FortiAuthenticator
  • FortiToken Cloud license is activated:
FortiToken Cloud license status on FortiAuthenticator

On Windows AD, an email is configured on domain users that will be provisioned with a FortiToken:

Email setting of Windows domain user

Initial FortiAuthenticator Setup
#

Some general objects need to be configured as part of the integration between FortiAuthenticator and Windows Active Directory:

Remote Authentication Server
#

When users are not locally created on FortiAuthenticator, a remote authentication server can be used to define the remote server where users and their credentials are defined, as well as the communication protocol with that server (LDAP, RADIUS, SAML, TACACS+, OAuth). Although remote user credentials are not stored in FortiAuthenticator, a remote user can be imported to integrate a MFA method.

To integrate FortiAuthenticator with the Windows Active Directory server via LDAP, the following steps are done:

  1. Go to Authentication > Remote Auth servers > LDAP. Select Create New:
Create new Remote Authentication Server on FortiAuthenticator
  1. Define the LDAP remote server settings:
  • Name: Windows-AD
  • Primary Server name/IP: 10.1.0.3
  • Based distinguished name: DC=testlabfound,DC=com (you can use the Browse button to query the server IP)
  • Bind type: Regular
  • Username: operator1 (a non-admin user is used in this case)
  • Password
  • Server Type: Microsoft Active Directory

You can leave other settings as default.

New LDAP server configuration on FortiAuthenticator

Note that Secure Connection is disabled, so LDAPS is not used in this scenario. Windows Active Directory Authentication is also disabled, but it can be used for allowing FortiAuthenticator to be logged in the Windows domain (required in specific use cases like 802.1X with PEAP-MSCHAPv2).

  1. Press Save. Then click on Browse to confirm the defined credentials have visibility to the desired OUs where the groups/users that will be imported to FortiAuthenticator are present:
LDAP Server browse option on FortiAuthenticator

A new pop up window appears. In this lab, the HQ OU contains the groups and users of interest to integrate with FortiAuthenticator for MFA:

Remote LDAP Server browser on Fortiauthenticator

The users from the HQ OU belong to the following custom groups:

UserMember of custom groups
jdoeFinance, Sales
dleeSales
sbrownFinance
  1. Go to Monitor > SSO > Domains. Expand the integrated domain, and verify the domain controller status is Sucessful by hovering over the DC node FQDN:
Monitor SSO Domains on FortiAuthenticator

Realm
#

Multiple domains can authenticate to a single FortiAuthenticator device by defining Realms. A realm defines against which database a user should be authenticated on FortiAuthenticator. This means that FortiAuthenticator uses a realm to identify the backend RADIUS, LDAP, or SAML authentication server used to authenticate the user.

When defining a Realm, the Name determines against what realm the authentication request is redirected for the received “user@domain”.

To create a realm, go to Authentication > User Management > Realms and select Create New. Define the Name and User Source (Remote Authentication LDAP Server):

New Realm for Windows AD on FortiAuthenticator

Save the changes. Verify the realm is listed:

Realms listed on FortiAuthenticator

Remote LDAP User Group
#

To create a new user group go to Authentication > User Management > User Groups. Define the user group parameters:

  • Name: finance
  • Type: Remote LDAP
  • User retrieval: Set a list of imported remote LDAP users
  • Remote LDAP: select the created remote LDAP server
Create new remote LDAP user group on FortiAuthenticator

Select Save. This user group doesn’t have any synced user yet. A remote user sync rule needs to be in place to populate this user group with the filtered remote users.

Remote User Sync Rule
#

This user sync rule will import the remote users that are member of the “Finance” AD group into the FortiAuthenticator “finance” local group. To configure a new LDAP remote user sync rule follow these steps:

  1. Go to Authentication > User Management > Remote User Sync, select LDAP tab, and then press Create New button:
Create new remote user sync rule on FortiAuthenticator
  1. Configure the initial parameters of the user sync rule:
  • Name: Finance-Sync
  • Remote LDAP: select the created remote LDAP server
  • Base distinguished name (auto-populated when Remote LDAP is selected)
  • LDAP Filter: select Set Group Filter button
Set Group filter for Remote user sync rule on FortiAuthenticator

A new pop up windows appears to set the group filter. Select the Finance AD group and press Use Filter:

Set group filter on FortiAuthenticator

Next, to confirm what users that are part of the selected group are filtered, use the Test Filter button:

Test filter on FortiAuthenticator

Two AD users belong to the Finance AD group:

LDAP user sync mapping preview on Fortiauthenticator
  1. Following the remote user sync rule creation, under Synchronization Attributes section, configure the settings:
  • OTP method assignment priority: in this scenario, only FortiToken Cloud - FortiToken Mobile is enabled.
  • Sync as: leave the default Remote LDAP User
  • Sync every: 1 hour (can be set to days/hours/minutes)
  • Group to associate users with: “finance” (Remote LDAP User Group previously created)
Enable FortiToken Cloud on LDAP user sync rule on FortiAuthenticator

Save the changes.

When FortiToken Cloud - FortiToken Mobile OTP method is enabled, a window message appears at the right indicating the AD user fields that will be synchronized to FortiAuthenticator:

User fields format with FortiToken Cloud - FortiToken Mobile
AD users matching the LDAP filter and without an email configured won’t be synched to FortiAuthenticator.

Under the LDAP User Mapping Attributes section of the remote user sync rule creation menu, it’s defined how each AD user attribute will be mapped into FortiAuthenticator user attributes:

Sync LDAP user mapping attributes on FortiAuthenticator

The importance of this remote user sync rule is that as new users are added to this filtered LDAP group, they will receive a FortiToken a soon as the automatic sync task runs (time according to the Sync every field value). Furthermore, once a user of that synched group is removed, the corresponding FortiToken license is released.

Synching AD Users
#

Now that the remote user sync rule is configured, it’s time to sync the filtered AD users:

  1. Still under Authentication > User Management > Remote User Sync, select the created rule and select Manual Sync:
Manual Sync AD users on FortiAuthenticator

A message confirming the start of the sync process shows up:

Sync process launched on FortiAuthenticator
  1. To confirm what users have been synched up, go to Authentication > User Management > Remote Users:
Synched remote LDAP users on FortiAuthenticator

Two users belong to “Finance” AD group: “jdoe” and “sbrown”. However only “jdoe” is listed. Going to Logging > Log Access > Logs gives more hints about the reason behind this:

FortiAuthenticator logs for synched users
  • Logs 68-69 indicate that 2 users were retrieved after performing the remote LDAP user sync. This matches the number of users that are part of the “Finance” group ("jdoe" and “sbrown”).
  • Logs 70-73 indicate that “jdoe” was added as a remote LDAP user into FortiAuthenticator, and a token was successfully assigned to the user with FortiToken Cloud. The user was notified to enable this token.
  • Log 74 indicate a user import error, because the user email needs to be defined if Two-Factor Authentication (TFA) method is FortiToken Cloud (FTC). As the log details show, we can determine “sbrown” doesn’t have an email configured in the AD:
Remote user sync error log details
  1. Still under Authentication > User Management > Remote Users, select the imported user “jdoe” to confirm their properties, under User Information section:
Synched information of remote LDAP user on FortiAuthenticator
  1. Under User Management > User Groups, confirm that the imported usee is part of the FortiAuthenticator user group:
LDAP user group with synched user on FortiAuthenticator

Activating the FortiToken
#

To provision the FortiToken on the synched user follow these steps:

  1. Install FortiToken Mobile Application from the Play Store or the Apple store on the smartphone device owned by the user.
  2. Verify an email has been delivered from fortiidentitycloud-noreply@email.fortinet.com to the AD user email with an activation code and a QR code. Use either of those two methods for activating the token:
Mail for activating FortiToken
  1. On the FortiToken Mobile app, select Scan Barcode to scan the QR code or Enter Manually to insert the code:
Empty FortiToken Mobile

After the token is added, you can verify its serial number:

Added Token to FortiToken Mobile

Windows FortiAuthenticator Agent Setup
#

The Windows FortiAuthenticator (FAC) Agent software can be installed on Windows domain endpoints to provide FortiAuthenticator OTP in the Windows authentication process.

When FortiAuthenticator OTP is part of the Windows authentication process, the login becomes in a two step process, that prevents password brute force attacks:

  1. Username and OTP are validated via FortiAuthenticator (destination port TCP/443)
  2. If the previous step is valid, username and password are validated against Active Directory as a regular Windows login (destination port TCP/389 for LDAP or TCP/636 for LDAPS).

The authentication workflow when using Windows FortiAuthenticator Agent is depicted below:

FortiAuthenticator Windows Agent workflow

Enabling REST API access on FortiAuthenticator
#

FortiAuthenticator Agent for Windows communicates with FortiAuthenticator via its FAC REST API. A key is generated for a FortiAuthenticator admin and must be inserted on the agents for allowing this communication.

A new administrator should be created with REST API access to FortiAuthenticator:

  1. Go to Authentication > User Management > Local Users, select Create New:
New local user on FortiAuthenticator
  1. Define the username and password. Set the Role to Administrator and enable the Full permissions option:
Full permission for admin on FortiAuthenticator

Save the changes. You’ll be required to insert the currently used admin password.

  1. In the next screen, under User Role section, enable the Web service access option:
Web service access for admin on FortiAuthenticator

Save the changes. You’ll be required to insert the currently used admin password.

  1. An access key is generated, copy the value and optionally send it via email. Then press OK
This is the only time the access key will be accessible for copying it.
FortiAuthenticator API access key

Apart from the administrator with REST API privileges, the FortiAuthenticator network interface also needs special permissions.

  • Under System > Network > Interfaces, verify the network interface has the REST API (/api/) option enabled (enabled by default):
REST API admin access enabled on FortiAuthenticator

Downloading and Installing the FortiAuthenticator Agent
#

The Windows user that will be installing the FAC agent needs to have local admin rights and be part of the domain, so the agent can detect the domain properly when installed.

To download the agent, login to FortiAuthenticator and navigate to Authentication > FAC Agent > Microsoft Windows Agent. The download process will start automatically.

Download FortiAuthenticator Microsoft Windows Agent

From the Windows device that will have FortiAuthenticator agent installed, follow these process:

  1. Execute the .exe FortiAuthenticator agent installer.
  2. Accept the license agreement, and select Next:
FortiAuthenticator Windows Agent Install - Step 1
  1. Confirm the installation path and select Next:
FortiAuthenticator Windows Agent Install - Step 2
  1. Press Next:
FortiAuthenticator Windows Agent Install - Step 3
  1. Enable Create a desktop shortcut if desired and click on Next:
FortiAuthenticator Windows Agent Install - Step 4
  1. Finally click on Install:
FortiAuthenticator Windows Agent Install - Step 5
  1. You may be required to install MS Visual C++. Select Yes:
FortiAuthenticator Windows Agent Install - Step 6
  1. Once the installation process ends, click on Finish:
FortiAuthenticator Windows Agent Install - Step 7

The FortiAuthenticator Agent interface is presented as follows:

FortiAuthenticator Windows Agent Configuration

Setting up the FortiAuthenticator Agent
#

Now that the FortiAuthenticator Agent is installed on the Windows host, it needs to be configured to communicate with FortiAuthenticator via its REST API.

  1. On FortiAuthenticator Agent under, General tab, Two Factor Authentication section select Configure:
Configure Two Factor Authentication on FortiAuthenticator Agent
  1. A new window opens, under General tab, set the FortiAuthenticator domain/IP, and the REST API admin username and API key:
Configuring FortiAuthenticator settings on FortiAuthenticator Agent
  1. Open the Two Factor Authentication configuration again and go to the Domains tab. Here you configure the following:
  • Default domain at Logon screen - select the domain
  • Available Domains - move the domain from Available Domains to the right (Include in Two Factor Authentication) to include it in the 2FA process.
Domains configuration on FortiAuthenticator Agent
The default domain “.” represents the local user. If the “.” domain is moved to Include in Two Factor Authentication, local user login will be disabled on the system by default. To enable full support for the local user, special configuration needs to be done in FortiAuthenticator as well.
  1. Press OK and then Save & Close.
  2. Test logging in to the Windows host with the domain user enabled with FortiToken “jdoe”:
FortiAuthenticator Agent Login fields

Select the domain, insert the username, password, and OTP to complete the login process successfully:

Testing login with FortiAuthenticator Agent

Login with a local user or a domain user without a OTP enabled is still possible on this Windows host where the agent has been installed. For example, selecting the default sign-in option with the domain user “sbrown” doesn’t require a OTP to login:

Windows built-in login
FortiAuthenticator Agent sign-in option

This is because the FortiAuthenticator agent enforcement hasn’t been enabled yet, which is located under the Credential Provider Options tab of the agent interface (will be seen later).

Configuring an exempt user (for bypassing 2FA)
#

An exempt user is capable of login to the PC without 2FA. This results handy in situations where for whatever reason it’s not possible to login to the PC anymore.

To configure an exempt user/group follow these steps on the FortiAuthenticator agent:

  1. Under General tab, on Two Factor Authentication section, select Configure.
  2. Navigate to Exempt Users. Select the Domain and User name to be exempted and then click on the right arrow. In this example, the local user .\admin and the “Domain Admins” group will be exempted:
  • For exempting a local user, select “.” as the domain and specify the user:
Local user as exempt user on FortiAuthenticator agent
By default, exempting a local user won’t make any change. This is because the “.” domain (i.e. no domain) hasn’t been moved from Available Domains to Include in Two Factor Authentication under the Domains tab. Once the “.” domain (i.e. no domain) is moved to Include in Two Factor Authentication, an OTP will be enforced for local users that are not listed under Exempt Users.
  • For exempting a domain group, select the domain, and then select the desired group:
Domain group as exempt group on FortiAuthenticator agent

To test the exempt user “admin”, select “.” or (No Domain) in the domain field and insert the exempted username and password, leaving the OTP field blank:

Testing exempt user on FortiAuthenticator agent login

To test the exempt user “administrator@testlabfound.com” that is part of the exempted group, specify the domain, and password. Leave the OTP field blank:

Testing exempt group on FortiAuthenticator agent login

Configuring an admin override
#

Admin override users can be configured to use their token to log on other users into their systems. This means that the admin override user just provides a OTP to a different user inserting their regular username and password in the login. This is useful in situations where the user doesn’t have access to its token because, for example it’s forgotten or lost, and there are no other backup options for MFA.

The AD user “sking”, which is not currently part of the AD group synched by a remote user synch rule, will be manually imported to FortiAuthenticator and then configured as an admin override on FortiAuthenticator Windows agent.

To manually import a user on FortiAuthenticator and enable OTP, follow these steps:

  1. On FortiAuthenticator, go to Authentication > User Management > Remote Users. Under LDAP tab, select the Import button:
Import LDAP user on FortiAuthenticator
  1. Define the Remote LDAP server and the Action, then click on Import:
Import remote LDAP user on FortiAuthenticator
  1. A new windows appears. Select the desired user to be imported and press OK:
Select remote LDAP user for import on FortiAuthenticator Agent
  1. A successful message should be shown. Select the user to further configure him:
Remote LDAP user imported on FortiAuthenticator
  1. On the Edit Remote LDAP User menu follow these process:
  • Enable One-Time Password (OTP) authentication
    • Deliver token codes from: FortiToken Cloud
    • Deliver token code by: FortiToken - Mobile
    • Activation delivery method: Email
  • Configure the user Email
Enable OTP on remote LDAP user on FortiAuthenticator
  1. Press Save and the user should received an email with the information to provision its FortiToken via code or QR code.
  2. Provision the token using FortiToken Mobile for the user “sking”.

To configure the user as admin override user on FortiAuthenticator follow these steps:

  1. Under General tab, on Two Factor Authentication section, select Configure.
  2. Go to the Authentication tab. Here, enable Allow user logins with Administrator OTP and configure the override user at the right:
Administrator override configuration on FortiAuthenticator agent
  1. Press OK and save the changes.

To test the admin override usage, trying login in with “jdoe” user:

  • Verify that a new Administrator Override option shows up when trying to login with FortiAuthenticator Agent:
Testing administrator override on FortiAuthenticator - Step 1
  • When this option is enabled, two new field must be filled - Administrator Name and Administrator OTP, which correspond to the admin override:
Testing administrator override on FortiAuthenticator - Step 2
  • In the following example, we’re simulating an scenario where the user “jdoe” doesn’t have access to its FortiToken OTP, so the admin override “sking” is assisting him with its own OTP:
Testing administrator override on FortiAuthenticator - Step 3

Enforcing FortiAuthenticator Agent Login
#

Up to this point, FortiAuthenticator Agent is configured for log in users with OTP. However, users can still bypass this MFA login, by selecting Other user option at the left of the login screen which doesn’t have the Fortinet logo. This option corresponds to the built-in Windows login mechanism:

Other user option for login on FortiAuthenticator agent

For example, the user “jdoe” which has a FortiToken associated can still login via the built-in Windows login mechanism without inserting any OTP:

Testing other user option for login on FortiAuthenticator agent

To disable the built-in Windows login mechanism, i.e. just leaving FortiAuthenticator Windows agent as the only login mechanism, open the FortiAuthenticator Agent program. Under Credential Provider Options, disable Permit Built-in Password Providers. Then click Save & Close to apply changes:

As mentioned in the messages below the Permit Built-in Password Providers, it’s recommended to have at least one exempt user with administrative access to the system. This would result useful in situations where FortiAuthenticator Agent malfunctions and it needs to be bypassed.
Disable permit built-in password providers on FortiAuthenticator agent

Confirm the changes, pressing Yes:

Confirm disable permit built-in password providers on FortiAuthenticator agent

Now, when trying to login, no other login mechanism option is available apart from the FortiAuthenticator agent login:

Testing disable permit built-in password providers on FortiAuthenticator agent

Enabling 2FA for Local Users
#

Reference: Technical Tip: Windows 2FA login using local users on FortiAuthenticator

By default, local users on Windows can login without inserting any OTP. The reason is that the “.” domain (i.e. no domain) hasn’t been moved from Available Domains to Include in Two Factor Authentication under the Domains tab:

Local users not included for 2FA on FortiAuthenticator agent

For example, a local user “zeus” can successfully login by selecting the “.” domain or (No domain) and just providing the username and password:

Testing local user on FortiAuthenticator agent

To enforce 2FA for local users, follow these steps:

  1. On FortiAuthenticator, go to Authentication > User Management > Realms and create a realm for the “.” domain (i.e. no domain):
Realm for local users login on FortiAuthenticator
  1. Navigate to Authentication > User Management > Local Users and set the username and password of the Windows user (credentials must match):
Configure local user on FortiAuthenticator
If the password defined on FortiAuthenticator for the local user doesn’t match the one in Windows device, the login process will fail.
  1. Click on Save and then enable the 2FA for local user by enabling One-Time Password (OTP) authentication and defining the Email:
Enable OTP for local user on FortiAuthenticator
  1. After saving, the token activation information is send to the specified email. Enable the token for the user.
  2. On FortiAuthenticator agent, move the “.” domain (i.e. no domain) to Include in Two Factor Authentication:
Local users included for 2FA on FortiAuthenticator agent

Now 2FA will be enforced for local users that are not listed under Exempt Users.

  1. By default, the override user won’t work with local user logins. A workaround is to change the local real name from “.” to any real name, e.g. local under the General tab of FortiAuthenticator agent:

Reference: Troubleshooting Tip: The override user is not working when using local admin

Configure real for local users on FortiAuthenticator Agent
Starting FortiAuthenticator Windows Agent v6.1 this issue is fixed. When inserting the admin override user, the domain must be specified using the format: domain\overrideuser
  1. On the Windows device, try logging in with the local user, inserting the password an OTP:
Testing local user authentication login with OTP on FortiAuthenticator Agent

In case the password of the local user on FortiAuthenticator doesn’t match the one on Windows device, this is the expected behavior:

  • If inserted credentials match with the local user on FortiAuthenticator, push OTP will be received as the user credential is verified with FAC. But, once the OTP is inserted, User name or password is incorrect error will be shown because credentials doesn’t match the Windows one.
  • If inserted credentials doesn’t match the one of the local user in FortiAuthenticator, no push OTP will be received by the user because of an invalid credentials on FAC.

References
#