Pular para o conteúdo

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.

  1. 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_id and 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.

  2. Is the account usable? A locked account, a deactivated one, or one outside its validity window is refused before any rule is looked at.

  3. 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.

  4. 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.

  5. 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
▼
refused

Global rules and application rules use the same building blocks:

ConditionMatches whenBuilt from
Application (global rules only)the request’s application is one of those listed — or Any applicationyour applications
Whothe user belongs to any of the selected user groups — or Any useruser groups, local or synced from a directory
Sourcethe end user’s IP address is inside any of the selected network objects — or Any sourcenetwork objects
Countrythe end user’s IP address is located (GeoIP) in a country of any selected list — or Any countrycountry lists
Whenthe time falls inside one of the windows of the selected time range — or Any timetime ranges
Validitythe 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.

The Source and Country conditions look at the end user’s address, never at the device that relays the request:

  • RADIUS — the Calling-Station-Id attribute the NAS sends (VPN concentrators and pam_radius usually 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_ip your 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 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).

OutcomeIn the logsWhat happened
DenyDenied by policyThe global rule that matched (or the Default rule) says Deny. Application rules are not reached; MFA is not asked.
Allow, MFA offAllowed without MFAAllowed, and MFA is off — either Require MFA is off in the application’s Settings, or the matched application rule has MFA off.
Allow, MFA rememberedMFA rememberedAllowed, 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 methodNo MFA method enrolledMFA is on but the user has not enrolled a method. The sign-in is refused.
Provider offMFA method disabledThe user’s method belongs to a provider an administrator has switched off. Refused.
IncompatibleMFA method not supported by the applicationThe 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 MFAMFA verifiedThe 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.

Policy:

#ApplicationsWhoSourceCountryAction
1Any applicationAny userAny sourceSanctioned countriesDeny
2Corporate VPNVPN usersAny sourceAny countryAllow
3GitLabDevelopersOffice LANAny countryAllow
—Default ruleDeny

Application rules of Corporate VPN:

#WhoSourceMFAAttributes
1Network adminsAny sourceOnFortinet-Group-Name = admins
—Default ruleOnFortinet-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.