Zum Inhalt springen

Fortinet FortiGate (RADIUS)

This page covers the built-in FortiGate template: a RADIUS server object on the FortiGate that sends user logins to OkYouIn. For RADIUS concepts see RADIUS. For administrator GUI single sign-on over SAML, see FortiGate admin (SAML).

PlatformSoftwareModesWhat was verified
FortiGate VM (multi-VDOM)FortiOS 7.6.7password, password + MFAFirewall authentication (HTTP auth portal) with TOTP on the portal’s challenge page; admin SSH login (wildcard and named remote admin, VDOM admin) with TOTP in the session; accounting; Fortinet-Group-Name, Fortinet-Access-Profile, Fortinet-Vdom-Name and Session-Timeout

Not verified: SSL VPN, IPsec VPN (FortiClient) and admin GUI login over RADIUS. The configuration is the same RADIUS server object, but test those flows before rolling out.

First factorOkYouIn checks the password only. FortiOS cannot check its local or LDAP password first and then ask RADIUS for the code only, so MFA only is not available.
Second factorTOTP, e-mail code, push (Web Push, Telegram) — shown as a second step (RADIUS Access-Challenge) on the login page, or in the SSH session right after the password.
AccountingFirewall authentication: Start, Interim-Update, Stop with counters. Admin logins: Start / Stop only after a challenge.
Client IPCalling-Station-Id is the user’s IP with call-station-id-type IP (the default sends the MAC address).
  1. In OkYouIn, open Access ▸ Applications ▸ Add application and pick FortiGate. The Connect tab shows the CLI below with the server address, shared secret and NAS-Identifier filled in.

  2. Under Sources, add the address the FortiGate sends from. With VDOMs this is the address of the VDOM interface that reaches OkYouIn.

  3. For push: raise the global remote authentication timeout to at least 60 seconds (config system global → set remoteauthtimeout, default 5). TOTP does not need it.

Run the CLI below, or use User & Authentication → RADIUS Servers in the GUI. With VDOMs enabled, run it inside the VDOM that reaches OkYouIn (config vdom / edit <VDOM>). The example uses 192.0.2.10 for OkYouIn and fgt-hq for the application’s NAS-Identifier.

config user radius
edit "OkYouIn"
set server "192.0.2.10"
set secret <SHARED-SECRET>
set auth-type pap
set radius-port 1812
set nas-id-type custom
set nas-id "fgt-hq"
set call-station-id-type IP
config accounting-server
edit 1
set status enable
set server "192.0.2.10"
set secret <SHARED-SECRET>
set port 1813
next
end
next
end
config user group
edit "OkYouIn-VPN"
set member "OkYouIn"
next
end
  • nas-id-type custom sends the application’s NAS-Identifier in Access-Request and Accounting-Request. If the application has no NAS-Identifier (identified by source only), leave the nas-id-type and nas-id lines out: FortiOS then sends its host name. A FortiGate that sends a different NAS-Identifier than the application expects gets “Access denied” at once.
  • call-station-id-type IP makes network conditions in your policy work.
  • Use the OkYouIn-VPN group wherever users authenticate: firewall policies (set groups), SSL VPN or IPsec authentication rules.

MFA is switched in OkYouIn only (Require MFA in Settings or per rule) — the FortiGate configuration is the same for password and password + MFA.

The wildcard admin lets every user OkYouIn accepts log in to the FortiGate with that admin profile and VDOM:

config user group
edit "OkYouIn-Admins"
set member "OkYouIn"
next
end
config system admin
edit "okyouin-admins"
set remote-auth enable
set wildcard enable
set remote-group "OkYouIn-Admins"
set accprofile "prof_admin"
set vdom "<VDOM>"
set accprofile-override enable
next
end

Admin SSH uses the SSH password method: the code prompt appears in the terminal after the password, and an empty answer ends the login. With VDOMs, create the group in the VDOM of the OkYouIn server and the admin under config global (set vdom to that VDOM). A named remote admin (wildcard disable, edit <username>) also works, but FortiOS 7.6 then requires a local password for it.

Set these in the application’s Rules tab.

AttributeEffect
Fortinet-Group-NameWith a match entry in the user group (config match / set server-name "OkYouIn" / set group-name <name>), only users who get that name are members — e.g. fgt-admins.
Fortinet-Access-ProfileAdmin profile for this login (e.g. prof_admin); needs set accprofile-override enable on the admin. An unknown name keeps the admin’s own profile.
Fortinet-Vdom-NameVDOM the admin lands in; needs set vdom-override enable (wildcard admin only). That VDOM needs the same RADIUS server and group, or the login ends after the code.
Session-TimeoutEnds firewall authentication sessions after N seconds; admin sessions ignore it.
ClassEchoed in firewall-authentication accounting. A Class from a rule replaces OkYouIn’s own Class token.

The accounting-server block inside the OkYouIn server sends accounting for logins through this server only; without it FortiOS sends none.

  • Firewall authentication: Start, Interim-Update and Stop with session time, byte and packet counters, terminate cause and Class.
  • Admin logins: Start and Stop only, without Calling-Station-Id or counters, and only when OkYouIn sent a challenge (MFA on). After a password-only admin login FortiOS sends no Start, so such sessions show up only once.

FortiOS ignores Acct-Interim-Interval from OkYouIn: leave Interim interval (seconds) empty and set acct-interim-interval <seconds> on the OkYouIn server object if you want Interim-Update.

FortiOS 7.6.7 sends Message-Authenticator in every Access-Request, so Strict is safe and recommended for this application. New applications start at Standard.

  1. Trigger a real login — the firewall authentication portal is the quickest — and complete the code page.

  2. Check Logging ▸ RADIUS log for the Accept, and the application’s Sessions tab for the session with its counters.

  3. diagnose test authserver radius <server> pap <user> <password> inside the VDOM tests the first factor and shows the first code prompt. It handles one challenge round only: a second challenge (for example after a wrong code) is reported as a failure. Use a real login flow to test retries.

SymptomLikely cause
”Access denied” immediatelyThe NAS-Identifier the FortiGate sends differs from the application’s (by default FortiOS sends its host name, which on a fresh VM is the serial number).
Push times out after a few secondsremoteauthtimeout is below 60.
Network conditions never matchcall-station-id-type is still the default (MAC address).
No answer at all in a VDOM setupThe RADIUS server object lives in a VDOM without a route to OkYouIn. Check Logging ▸ RADIUS log ▸ Dropped packets for packets from an unexpected source.
Admin lands in the wrong VDOM, or login ends after the codeFortinet-Vdom-Name names a VDOM without the same RADIUS server and group.