Sign-in
People sign in to Hearth with a Hearth account (a username or email and a password, with two-factor sign-in and passkeys), through your organisation's identity provider, or both. Hearth is only ever the client of a provider: it does not act as an OpenID Connect or SAML provider for other systems.
Hearth accounts
Passwords are stored as argon2id hashes and must be at least ten characters long. People can add an authenticator app (TOTP), passkeys and backup codes under Settings, Two-factor and passkeys, and sign in with a passkey alone. Phone and desktop apps that speak WebDAV, CalDAV or CardDAV use app passwords, one per device, each revocable.
Wrong passwords and codes
Hearth never locks an account for good. Wrong tries are held back with growing waits instead:
- a password: two wrong tries free, then 1 minute, then 5 minutes, then that way of signing in is closed for a day;
- a two-factor code: one wrong try free, then 1 minute, then a day.
Each account and each kind of secret has its own count. A browser or phone that signed in before keeps its own, more lenient count, so a stranger's guesses do not lock the owner out of their usual device. A wrong app password holds back only that app password.
Every network (an IPv4 address or an IPv6 /64) also has a ceiling across
all accounts: 300 wrong tries in 15 minutes by default
(SIGNIN_FAILURES_PER_IP, SIGNIN_WINDOW_MINUTES). The answer is the
same whether the account exists or not.
These counts need the visitor's real address, so set TRUSTED_PROXIES
for your reverse proxy (Installing).
Sessions
A browser session ends after 168 hours unused (SESSION_IDLE_HOURS) and
30 days after sign-in at the latest (SESSION_MAX_DAYS). The phone and
desktop apps stay signed in while they are used, and end after 180 days
unused (APP_SESSION_IDLE_DAYS). A security
policy can shorten both for browsers.
Emailed codes
Emailed codes count as a second factor only when you allow them under Administration, Security, Ways that count, and only when outgoing mail is set up. They prove that someone can read the mailbox, which is weaker than an authenticator app or a passkey.
The sign-in page
Administration, Theming sets what the sign-in page looks like: the organisation's name, a slogan, the logo, the colour, and one of three designs (Split, Card or Photo) with its background. The Legal notice link and Privacy policy link appear at the foot of the page when set.
The behaviour is the same in every design. When a provider is switched on, its "Sign in with" button leads the other ways in.
Your organisation's provider
Go to Administration, Sign-in. Nothing changes for anyone until you turn on Sign-in through your organisation and select Save.
The page has three kinds of provider under Provider:
- OpenID Connect: Zitadel, Keycloak, Okta, Google Workspace and any other standard provider.
- Microsoft Entra ID: a preset with Entra's own rules.
- SAML 2.0: AD FS, Entra ID, Okta, Keycloak, Shibboleth and others.
Under each, Button name is the name on the sign-in page ("Sign in with Contoso").
OpenID Connect
- At your provider, register a web application (a confidential client using the authorization code flow).
- Give it Hearth's Redirect URI, shown at the foot of Hearth's page, for
example
https://hearth.example.org/api/v1/auth/sso/callback. - If the provider supports back-channel logout, register Hearth's
Back-channel logout URI too (
https://hearth.example.org/api/v1/auth/sso/logout). - In Hearth, type the Issuer (the provider's address, whose
/.well-known/openid-configurationmust answer), the Client ID and the Client secret. - Keep the Scopes as suggested:
openid profile email offline_access.offline_accesslets Hearth check every ten minutes that each person may still sign in (see Ending access). - Check the Claims: Username (
preferred_username), Email (email), Name (name) and Groups (groups). Change them if your provider uses other names. - Choose New people (below), turn on Sign-in through your organisation and select Save.
The client secret is sealed with the master key and never shown again; the field then reads "Saved". Leave it empty to keep the saved one.
Every round trip uses PKCE, state and nonce, and the ID token is checked against the provider's keys.
Notes for some providers:
- Zitadel: create a Web application with the code flow and a client secret; turn on "User roles inside ID token" if you map roles to groups.
- Keycloak: the issuer is the realm's address
(
https://id.example.org/realms/contoso). Add a "groups" mapper to the client's scope for group mapping. - Okta: the issuer is your Okta domain or its authorization server. Add a groups claim in the authorization server's claims.
- Google Workspace: the issuer is
https://accounts.google.com. Google sends no groups claim, so map groups in Hearth by hand or with SCIM from another directory.
Hearth is tested against Keycloak and Zitadel. Other providers follow the same standard but have not been tested by the project.
Microsoft Entra ID
Choose Microsoft Entra ID under Provider. Hearth fills the scopes and claims for Entra and builds the issuer from the tenant ID. Use the tenant's ID (a GUID), not its domain name.
In the Microsoft Entra admin centre:
- Under App registrations, select New registration. Give it a name, choose "Accounts in this organizational directory only", and add a Redirect URI of type Web: Hearth's Redirect URI from Administration, Sign-in.
- Under Authentication, set Front-channel logout URL to Hearth's Front-channel logout URL. Leave ID tokens and Access tokens (the implicit flow) off.
- Under Certificates & secrets, select New client secret. Copy its Value (not its ID) into Hearth's Client secret. Note its end date and make a new one before it.
- Under Token configuration, select Add optional claim, token type ID,
and add
email,xms_edov,verified_primary_emailandverified_secondary_email. Accept adding the Microsoft Graph email permission when asked. - For groups, use app roles: under App roles, create one role per Hearth
group (allowed member types Users/Groups, a Value such as
ward-4). Then under Enterprise applications, open the app, and under Users and groups assign people or groups to the roles. - Under API permissions, check that Microsoft Graph has the delegated
permissions
openid,profile,emailandoffline_access, and select Grant admin consent. - On the Overview, copy the Application (client) ID into Hearth's Client ID and the Directory (tenant) ID into Tenant ID.
- In Hearth, map each role's Value under Groups from the provider, turn on Sign-in through your organisation and select Save.
What Hearth does differently for Entra:
- Entra sends no
email_verified. Hearth trusts an address only when the token carriesxms_edovtrue or names the address inverified_primary_emailorverified_secondary_email. Only a trusted address links an existing account, accepts an invitation or is kept on a new account. - Groups come from the
rolesclaim. If you use Entra's groups claim instead (Add groups claim, Security groups, emitted as Group ID, then map those IDs), note that Entra stops listing groups after 200. Hearth does not ask Microsoft Graph for the rest, and in that case leaves the person's mapped groups as they were. - Entra has no back-channel logout. When a person signs out at Microsoft, Entra loads Hearth's front-channel logout address in a hidden frame, and the browser sessions that came through that Entra session end.
- Hearth disables an account only for Entra's answers that mean the person may no longer sign in (disabled, not in the tenant, locked, a guest removed). Other refusals are logged and asked again later.
The Entra rules are tested with tokens shaped like Entra's. They have not yet been tested against a real Entra tenant.
SAML 2.0
- Choose SAML 2.0 under Provider. Hearth suggests the attributes
uid,mail,displayNameandgroups; AD FS and Entra name theirs by URI, so change them to match. - Under Service provider, copy Hearth's Metadata URL (or select Copy metadata to paste the document) into your provider. The Entity ID, Assertion consumer service and Single logout addresses are shown for providers set up by hand.
- Give Hearth your provider's metadata: its Metadata URL (read at every save and again each day) or, without one, the XML pasted under Metadata.
- Set the switches:
- The provider verifies addresses: turn on only if your provider guarantees that the addresses it sends belong to the person. Linking and invitations rely on it.
- Encrypted assertions only: refuse assertions that are not encrypted. Encrypted ones are read either way.
- Sign-in started at the provider: allow sign-ins that begin in the provider's portal (unsolicited responses). Off by default.
- Turn on Sign-in through your organisation and select Save.
Hearth refuses an assertion without its own signature, one signed with SHA-1, a transient NameID, an answer used before or meant for another request. Single logout works both ways. SAML has no way for Hearth to ask whether a person may still sign in, so end access through SCIM or by disabling the account in Hearth.
Hearth's SAML is tested against Keycloak. AD FS, Entra ID, Okta and Shibboleth have not been tested by the project.
New people
New people decides what happens when someone signs in through the provider for the first time and Hearth has no account linked to them:
- Invited people only: only someone with an open invitation to the address the provider vouches for gets an account. Everyone else is refused with "There is no account for this sign-in".
- An account at first sign-in: anyone the provider lets through gets a member account.
In both cases an open invitation for that address is used, with its groups. Accounts made through the provider have no Hearth password.
Linking existing accounts
When an existing Hearth account has the same verified address, the person is asked for their Hearth password once, on a "Link and sign in" page. From then on the provider's sign-in opens that account.
Groups from the provider
Under Groups from the provider, select Add mapping, type a Claim value (or Attribute value for SAML) and choose the Hearth group it means. At every sign-in, the person's mapped groups follow the claim: they join the groups whose values they carry and leave the mapped ones they no longer carry. Groups you did not map stay as admins set them.
Two-factor at the provider
Turn on Count the provider's two-factor if your provider enforces it.
Hearth then accepts the provider's statement that a second factor was
used (the amr claim mfa for OpenID Connect; REFEDS MFA or Microsoft's
multiple-authentication class for SAML) for security policies that
require two-factor sign-in.
Signing out
Turn on Sign out at the provider too to end the provider's session when someone signs out of Hearth. Signing out at the provider ends the browser sessions that came through it, through back-channel logout (OpenID Connect), front-channel logout (Entra) or single logout (SAML). The phone and desktop apps stay signed in.
Ending access
With offline_access, Hearth uses each linked person's refresh token
every ten minutes. When the provider refuses it, because the person was
disabled or removed there, Hearth disables the account and records it as
the provider's doing. A later sign-in through the provider, or an
accepted refresh, enables it again. A provider that does not answer
changes nothing.
The line under the switch counts the accounts linked, followed and disabled by the provider.
Making the provider the only way in
A security policy can make the provider the only way in, for everyone or chosen groups. Hearth's admins always keep their own sign-in, so a fault at the provider never locks you out.
The phone app
The phone app signs in through the system's browser sheet and comes back to the app. Nothing extra is needed at the provider beyond the Redirect URI above.
Provisioning with SCIM
Your directory (Entra ID, Okta and others) can create, change, switch off and remove accounts and groups in Hearth with SCIM 2.0.
- Under Administration, Sign-in, Provisioning (SCIM), turn on Accounts and groups from the directory.
- Copy the SCIM address (
https://hearth.example.org/api/v1/scim/v2). - Select Make a token and copy it. It is shown only once; Hearth keeps only its hash. New token replaces it, and the directory's old token stops working.
- Give both to your directory.
For Entra ID: under Enterprise applications, open the app, then
Provisioning, mode Automatic. Tenant URL is the SCIM address, Secret
Token the token. Map userName to userPrincipalName (or mail), and
assign the users and groups to provision.
What the directory can do:
- Users: create (a new account without a password, or an existing
member's account with the same address taken over), change, switch off
and on (
active), and delete. Deleting switches the account off and forgets the link; its files stay until an admin deletes the account. Admins' and guests' accounts are never taken over. - Groups: create (or take over an admin's group with the same name), rename, add and remove members, and delete. Members added by SCIM are plain members, never group admins.
Every change goes through the same code as an admin's and appears in the audit log as made by "directory (SCIM)".
SCIM is tested with Hearth's own client. It has not been run against a real Entra or Okta provisioning job yet.
Not available yet
- Sign-in through LDAP or Active Directory directly.
- Emailed sign-in links, account recovery by mail, and mail about sign-ins from new devices for Hearth's own accounts.