Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Authentication, sessions and two-factor sign-in

How users and machines authenticate to Exponential - password storage and policy, the list of well-known passwords, lockout, session handlers and cookies, two-factor sign-in with sevenx_authentication_2fa, OAuth 2.0 and…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/software-engineers/authentication-sessions-and-2fa.md

On this page

Authentication, sessions and two-factor sign-in

This page is for engineers who design sign-in for a site, integrate machines through the API, or review account security. It covers people (passwords, two factors, sessions) and machines (OAuth tokens, API keys).

Contents

  1. Passwords
  2. Sessions
  3. Two-factor sign-in
  4. Machines: OAuth and API keys
  5. Login handlers
  6. Decisions to make

Passwords

AspectShipped behaviorSetting or source
StoragePHP's password_hash() (bcrypt today), older hashes upgraded at sign-insite.ini [UserSettings] HashType=php_default
Minimum length10[UserSettings] MinPasswordLength
Well-known passwordsrefused everywhere a password is set, with simple variantsexpWeakPasswordList (Weak passwords and reset key lifetime)
Forgot-password linkexpiresthe same page
Lockout after failed sign-insoff (0) until you set a number[UserSettings] MaxNumberOfFailedLogin
Other sessions on password changeended[PasswordSettings] EndOtherSessions=enabled

Unknown logins and wrong passwords cost the same time, and "forgot password" answers are uniform, so an attacker cannot list accounts (Security standards). Since August 2026 an account without an ezuser_setting row cannot sign in: the login fails closed.

Sessions

  • site.ini [Session] SessionTimeout (default 360 days) ends a session after its last use.
  • [Session] Handler empty (the default) keeps sessions in PHP's own storage; ezpSessionHandlerDB keeps them in the ezsession table, which several web nodes can share and the administration can list and end (Sessions).
  • Session cookies are HttpOnly and SameSite by default since September 2026, and Secure over HTTPS (CookieSecure=auto); the session id is regenerated at sign-in.
  • Under Velocity, $_SESSION is written and emptied after each request.

Two-factor sign-in

The extension sevenx_authentication_2fa, required by composer.json and activated by the installers, adds a second step after the password: a TOTP code from an authenticator app (RFC 6238, PHP built-ins only) or a one-time code by e-mail. A datatype on the user class stores each user's method and secret; a login handler checks the password and then completes the sign-in or redirects to the challenge. Pending challenges are JSON files under var/, so it needs no Redis or Valkey. The same extension carries social-login handlers as skeletons to customize (Two-step sign-in, sevenx_authentication_2fa).

Machines: OAuth and API keys

MechanismUse
OAuth 2.0 tokensPOST /api/auth/v1/oauth/token with authorization_code or refresh_token, for applications acting for a user (OAuth and API keys, OAuth authorize policy)
Personal API keysAuthorization: Bearer expk_...; made by a user with apikey/create, scoped, expiring, revocable, shown once (Personal API keys)
expservices tokensremote services and apps (Remote services and apps)

Whatever authenticates a REST request, every read and write checks the user's policies (REST API v1 and v2).

Login handlers

site.ini [UserSettings] LoginHandler[] lists the handlers tried in order; the two-factor extension adds its own before standard. Directory services (LDAP and others) plug in the same way (API and protocol standards).

Decisions to make

  • To do: Is two-factor sign-in required for administrators and editors?
  • To do: Is a lockout number set, and is TrustedProxies[] right so it counts the real client addresses?
  • To do: Which session handler: PHP's storage on one node, or the database for several nodes and session control?
  • To do: Which machines get API keys, with which scopes and lifetimes, and who rotates them?
  • To do: Are sign-in events watched (the audit trail's access.session.* events and the brute-force alert rule)?

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x