How a sign-in is decided
Every sign-in that reaches OkYouIn — a VPN login over RADIUS, a browser on the single sign-on page, a Windows logon through the agent, a call to the Verify API — is decided the same way. There is one place that says Allow or Deny, the global policy, and one place per application that says how an allowed sign-in is served, the application rules. MFA and the attributes sent back to the application come out of the second step.
This page walks through the whole path. The pages that follow describe each piece in detail: the global policy, application rules, the objects rules are built from, GeoIP, the policy tester and brute-force protection.
The funnel
Section titled “The funnel”-
Which application is this? The request is matched to exactly one application by what the protocol proves: a RADIUS client’s address, NAS-Identifier and shared secret; an OIDC
client_idand its secret; a SAML entity ID and its registered ACS URL; a Verify API key; a Windows agent’s registration. A request that matches no application is refused. See Applications. -
Is the account usable? A locked account, a deactivated one, or one outside its validity window is refused before any rule is looked at.
-
The global policy. OkYouIn walks the ordered list of global rules from the top. The first rule whose conditions all match decides: Allow or Deny. If nothing above matches, the fixed Default rule at the bottom applies — and it ships as Deny.
-
The application’s rules. Only after an Allow, OkYouIn walks the application’s own ordered rules, again first match wins, ending with that application’s Default rule. The matched rule decides whether MFA is asked and which attributes (RADIUS reply attributes, OIDC claims, SAML attributes, Verify API attributes) are sent on success. Application rules never allow or deny.
-
MFA. If the effective MFA is on, the user completes their enrolled second factor. If it is off, the sign-in is accepted after the first factor.
request ─► application ─► account usable? ─► global policy ─► application rules ─► MFA ─► accepted │ Deny + attributes ▼ refusedConditions: how a rule matches
Section titled “Conditions: how a rule matches”Global rules and application rules use the same building blocks:
| Condition | Matches when | Built from |
|---|---|---|
| Application (global rules only) | the request’s application is one of those listed — or Any application | your applications |
| Who | the user belongs to any of the selected user groups — or Any user | user groups, local or synced from a directory |
| Source | the end user’s IP address is inside any of the selected network objects — or Any source | network objects |
| Country | the end user’s IP address is located (GeoIP) in a country of any selected list — or Any country | country lists |
| When | the time falls inside one of the windows of the selected time range — or Any time | time ranges |
| Validity | the current time lies between Valid from and Valid until (either may be open) | dates on the rule |
Inside one condition the items are OR’ed (any group, any network object, any list). Between conditions everything is AND’ed: all of a rule’s conditions must match. A disabled rule, or one outside its validity, is skipped as if it were not there.
Which address is “the end user’s”
Section titled “Which address is “the end user’s””The Source and Country conditions look at the end user’s address, never at the device that relays the request:
- RADIUS — the
Calling-Station-Idattribute the NAS sends (VPN concentrators andpam_radiususually send the client’s IP). The packet’s source address identifies the application, not the user. If the NAS sends no usable address, the request has no end-user IP. - Single sign-on (OIDC, SAML) — the browser’s address as it reaches OkYouIn.
- Windows logon agent — the address the agent reports (for RDP, the connecting client).
- Verify API — the
client_ipyour server puts in the call, if any.
Some application templates declare that their device never sends the user’s address. For those, a Source condition never matches and the country is always Unknown; the rule editors warn you when you build such a rule.
The decision, step by step
Section titled “The decision, step by step”The result of the funnel is one of these outcomes. The policy tester shows the same decision before anyone signs in, and the logs record it for every real sign-in (the log wording is in the second column).
| Outcome | In the logs | What happened |
|---|---|---|
| Deny | Denied by policy | The global rule that matched (or the Default rule) says Deny. Application rules are not reached; MFA is not asked. |
| Allow, MFA off | Allowed without MFA | Allowed, and MFA is off — either Require MFA is off in the application’s Settings, or the matched application rule has MFA off. |
| Allow, MFA remembered | MFA remembered | Allowed, MFA on, but the same user passed MFA for this application a short while ago and the application has an MFA cache (RADIUS applications, for example OpenVPN renegotiation). |
| No method | No MFA method enrolled | MFA is on but the user has not enrolled a method. The sign-in is refused. |
| Provider off | MFA method disabled | The user’s method belongs to a provider an administrator has switched off. Refused. |
| Incompatible | MFA method not supported by the application | The application’s device cannot deliver the user’s method (for example, a TOTP code to a device that cannot show a prompt). Refused, with the reason named. |
| Allow after MFA | MFA verified | The user completed their second factor; the sign-in is accepted and the matched rule’s attributes are sent. |
Users are never told why they were refused: a wrong password, an unknown account and a policy Deny all look the same from the outside. The real reason is recorded for you in the logs.
A worked example
Section titled “A worked example”Policy:
| # | Applications | Who | Source | Country | Action |
|---|---|---|---|---|---|
| 1 | Any application | Any user | Any source | Sanctioned countries | Deny |
| 2 | Corporate VPN | VPN users | Any source | Any country | Allow |
| 3 | GitLab | Developers | Office LAN | Any country | Allow |
| — | Default rule | Deny |
Application rules of Corporate VPN:
| # | Who | Source | MFA | Attributes |
|---|---|---|---|---|
| 1 | Network admins | Any source | On | Fortinet-Group-Name = admins |
| — | Default rule | On | Fortinet-Group-Name = staff |
A member of VPN users and Network admins connecting to the VPN from an allowed country passes rule 1 (country not in the list), matches rule 2 (Allow), then application rule 1: MFA is asked, and on success the VPN gateway receives Fortinet-Group-Name = admins. The same user trying GitLab from home matches neither rule 2 (wrong application) nor rule 3 (not in Office LAN) and lands on the Default rule: Deny.