Authentication
Authentication
Section titled “Authentication”Configures authentication settings including password policies and default roles.
This object can be configured from the WebUI under Settings › Authentication › General
Fields
Section titled “Fields”directoryId
Section titled “directoryId”Type:
Id<Directory>?External directory used for authentication, or null to use the internal directory
defaultUserRoleIds
Section titled “defaultUserRoleIds”Type:
Id<Role>[]Default roles to assign for accounts.
defaultGroupRoleIds
Section titled “defaultGroupRoleIds”Type:
Id<Role>[]Default roles to assign for groups.
defaultTenantRoleIds
Section titled “defaultTenantRoleIds”Type:
Id<Role>[]· enterpriseDefault roles to assign for tenants in multi-tenant environments.
defaultAdminRoleIds
Section titled “defaultAdminRoleIds”Type:
Id<Role>[]Default roles to assign for administrators.
passwordHashAlgorithm
Section titled “passwordHashAlgorithm”Type:
PasswordHashAlgorithm· default:"argon2id"Password hashing algorithm to use for storing user passwords in the internal directory.
passwordMinLength
Section titled “passwordMinLength”Type:
UnsignedInt· default:8· min: 1 · max: 100Minimum length for user passwords in the internal directory.
passwordMaxLength
Section titled “passwordMaxLength”Type:
UnsignedInt· default:128· min: 1 · max: 1000Maximum length for user passwords in the internal directory.
passwordMinStrength
Section titled “passwordMinStrength”Type:
PasswordStrength· default:"three"Minimum strength for user passwords in the internal directory, calculated using the zxcvbn algorithm.
passwordDefaultExpiry
Section titled “passwordDefaultExpiry”Type:
Duration?Default expiration time for user passwords in the internal directory, after which the user will be required to change their password.
maxAppPasswords
Section titled “maxAppPasswords”Type:
UnsignedInt?· default:5· min: 1The default maximum number of app passwords a user can create
maxApiKeys
Section titled “maxApiKeys”Type:
UnsignedInt?· default:5· min: 1The default maximum number of API keys a user can create
JMAP API
Section titled “JMAP API”The Authentication singleton is available via the urn:stalwart:jmap capability.
x:Authentication/get
Section titled “x:Authentication/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
For singletons, the ids argument should be the literal singleton (or null to return the single instance).
This method requires the sysAuthenticationGet permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:Authentication/get", { "ids": [ "singleton" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:Authentication/set
Section titled “x:Authentication/set”This is a standard Foo/set method as defined in RFC 8620, Section 5.3.
For singletons, only the update argument with id singleton is accepted; create and destroy arguments are rejected.
This method requires the sysAuthenticationUpdate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:Authentication/set", { "update": { "singleton": { "directoryId": "<Directory id>" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get AuthenticationUpdate
Section titled “Update”stalwart-cli update Authentication --field directoryId='<Directory id>'PasswordHashAlgorithm
Section titled “PasswordHashAlgorithm”| Value | Label |
|---|---|
argon2id | Argon2id |
bcrypt | Bcrypt |
scrypt | Scrypt |
pbkdf2 | Pbkdf2 |
PasswordStrength
Section titled “PasswordStrength”| Value | Label |
|---|---|
zero | Too guessable: risky password. (guesses < 10^3) |
one | Very guessable: protection from throttled online attacks. (guesses < 10^6) |
two | Somewhat guessable: protection from unthrottled online attacks. (guesses < 10^8) |
three | Safely unguessable: moderate protection from offline slow-hash scenario. (guesses < 10^10) |
four | Very unguessable: strong protection from offline slow-hash scenario. (guesses >= 10^10) |