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).
Verified on
Section titled “Verified on”| Platform | Software | Modes | What was verified |
|---|---|---|---|
| FortiGate VM (multi-VDOM) | FortiOS 7.6.7 | password, password + MFA | Firewall 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.
What works
Section titled “What works”| First factor | OkYouIn 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 factor | TOTP, 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. |
| Accounting | Firewall authentication: Start, Interim-Update, Stop with counters. Admin logins: Start / Stop only after a challenge. |
| Client IP | Calling-Station-Id is the user’s IP with call-station-id-type IP (the default sends the MAC address). |
Before you start
Section titled “Before you start”-
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.
-
Under Sources, add the address the FortiGate sends from. With VDOMs this is the address of the VDOM interface that reaches OkYouIn.
-
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.
Configure the device
Section titled “Configure the device”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 nextendconfig user group edit "OkYouIn-VPN" set member "OkYouIn" nextendnas-id-type customsends the application’s NAS-Identifier in Access-Request and Accounting-Request. If the application has no NAS-Identifier (identified by source only), leave thenas-id-typeandnas-idlines 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 IPmakes 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.
Admin login (optional)
Section titled “Admin login (optional)”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" nextendconfig 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 nextendAdmin 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.
Reply attributes
Section titled “Reply attributes”Set these in the application’s Rules tab.
| Attribute | Effect |
|---|---|
Fortinet-Group-Name | With 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-Profile | Admin 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-Name | VDOM 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-Timeout | Ends firewall authentication sessions after N seconds; admin sessions ignore it. |
Class | Echoed in firewall-authentication accounting. A Class from a rule replaces OkYouIn’s own Class token. |
Accounting
Section titled “Accounting”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.
BlastRADIUS
Section titled “BlastRADIUS”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.
Verify
Section titled “Verify”-
Trigger a real login — the firewall authentication portal is the quickest — and complete the code page.
-
Check Logging ▸ RADIUS log for the Accept, and the application’s Sessions tab for the session with its counters.
-
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.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Likely cause |
|---|---|
| ”Access denied” immediately | The 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 seconds | remoteauthtimeout is below 60. |
| Network conditions never match | call-station-id-type is still the default (MAC address). |
| No answer at all in a VDOM setup | The 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 code | Fortinet-Vdom-Name names a VDOM without the same RADIUS server and group. |