Authentication
Search2o has built-in authentication with email and password. An administrator sets the session and password rules to the organization's requirements on the Admin › Authentication page. People can also sign in through your identity provider with single sign-on, alongside password sign-in or instead of it.
Sessions
A browser sign-in creates a session held in an HTTP-only cookie. The session ends after a period of inactivity, and in any case after a maximum lifetime; the defaults are one hour and twelve hours. A change to any of these affects a signed-in user only when that user signs in again. See Authentication in the REST API for how clients sign in.
Passwords
The password policy sets the length and the character classes a password must contain, and is enforced on every new password. Users can be made to change their password after a number of days. A password reset signs out every session of that user.
Restricting who can be added
With an allowed email domain set, only addresses in that domain can be added as users. The domain is best set before adding users beyond the founding team.
Emails and one-time codes
Two emails are sent: one when an administrator adds a user, and one when a person clicks New user / Forgot password on the sign-in dialog. Both are HTML templates that can be edited. The second carries a one-time code, valid for a set number of minutes and usable once; the person enters the code and chooses a password. The added-user email carries no code. A code requested for an address the account does not know produces a notification rather than an email.
Sign-in methods
Every account has password sign-in, and can add single sign-on beside it. Password sign-in can be turned off only once single sign-on is configured, so that an account always keeps a way to sign in.
| Field | Type | Default | Description |
|---|---|---|---|
cookie | CookieModel | Cookie settings for user sessions. | |
integrationTokenMaxAgeDays | integer | 365 | How long a token issued to an integration stays valid. Leave empty for tokens that never expire. |
builtinAuth | BuiltinAuthModel | The settings for signing in with an email and a password: the password policy, session lengths, and the emails sent to users. Every account starts with this, and keeps these settings even when single sign-on is the way in. | |
isBuiltinAllowed | boolean | true | Whether users may sign in with a password. Turn it off only once single sign-on is configured and proven, or nobody can sign in. With it on beside single sign-on, both are offered. |
sso | OidcAuthModel or Saml2AuthModel | How users of this account sign in with single sign-on, and the settings for that method. Empty means password sign-in only. |
Password sign-in settings
| Field | Type | Default | Description |
|---|---|---|---|
password | PasswordModel | What a password must contain. | |
maxInactivityMinutes | integer | 240 | How long a session may sit idle before the user is signed out. |
reauthenticateAfterMinutes | integer | 720 | How long a session lasts before the user must sign in again, however active they are. |
emailCodeActiveMinutes | integer | 30 | How long a code emailed for a new user or a password reset stays usable. |
mustChangePasswordEveryDays | integer | 365 | How often users must choose a new password. |
emailDomain | string | Only addresses in this domain may have accounts. | |
newUserEmail | EmailFormat | Sent when an administrator adds a user. | |
forgotPasswordEmail | EmailFormat | Sent when a user asks to reset their password. |
Session cookie
| Field | Type | Default | Description |
|---|---|---|---|
key | "search2o_session" | "search2o_session" | The name of the session cookie. |
path | "/" | "/" | The path the cookie is sent for. |
httponly | True | true | Whether the cookie is hidden from JavaScript. Leave on unless a client needs to read it. |
max_age | integer | 86400 | How long the cookie lives. |
domain | string | The domain the cookie is valid for. | |
secure | boolean | true | Whether the browser sends the cookie only over HTTPS. |
samesite | "Lax" | "Strict" | "None" | "Lax" | When the browser sends the cookie on cross-site requests. |
Password policy
| Field | Type | Default | Description |
|---|---|---|---|
minLength | integer | 8 | The fewest characters a password may have. |
maxLength | integer | 128 | The most characters a password may have. |
minSpecialChars | integer | 2 | How many special characters a password must contain. |
minUpper | integer | 2 | How many uppercase letters a password must contain. |
minLower | integer | 2 | How many lowercase letters a password must contain. |
minNumbers | integer | 2 | How many digits a password must contain. |
passwordRules | string | "Minimum 2 each of lower, upper, number and special characters" | Help text shown in the UI describing these rules. |
Emails
| Field | Type | Default | Description |
|---|---|---|---|
subjectrequired | string | The subject line of the email. | |
bodyHtmlrequired | string | The body of the email, as HTML. This must be set. |

