Skip to content

SSO Sessions

Autentico maintains SSO sessions so that once a user authenticates, subsequent authorization requests from any registered client are served without re-prompting for credentials — standard single sign-on behavior.

When a user logs in successfully, Autentico creates a session record and stores a session cookie in the browser. The cookie is scoped to the Autentico domain.

On a new authorization request:

  1. Autentico reads the session cookie
  2. Looks up the session record in the database
  3. Checks whether the session is still active and within the idle timeout window
  4. If valid: issues an authorization code without showing the login page
  5. If expired or missing: presents the login page

Sessions have two separate lifetime controls:

SettingDefaultDescription
sso_session_max_age720hAbsolute maximum session duration — the session expires after this regardless of activity
sso_session_idle_timeout168hIf the user has no activity for this long, the session expires

Both use Go duration format: 24h, 168h, 720h, etc.

The idle timeout can be overridden per-client, so different clients can have stricter session requirements. See Per-Client Overrides.

Sessions are stored in the sessions table with the following fields:

FieldDescription
idOpaque session ID, stored in the browser cookie
user_idThe authenticated user
user_agentBrowser user-agent string
ip_addressClient IP at login time
last_activity_atUpdated on each authorization request (used for idle timeout)
created_atSession creation time
expires_atAbsolute expiry (created_at + sso_session_max_age)
deactivated_atSet when the session is explicitly logged out

The GET /oauth2/logout endpoint deactivates the current SSO session, clears the session cookie, and redirects the user. After logout, the next authorization request will require re-authentication.