Hearth documentation

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:

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:

Under each, Button name is the name on the sign-in page ("Sign in with Contoso").

OpenID Connect

  1. At your provider, register a web application (a confidential client using the authorization code flow).
  2. 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.
  3. If the provider supports back-channel logout, register Hearth's Back-channel logout URI too (https://hearth.example.org/api/v1/auth/sso/logout).
  4. In Hearth, type the Issuer (the provider's address, whose /.well-known/openid-configuration must answer), the Client ID and the Client secret.
  5. Keep the Scopes as suggested: openid profile email offline_access. offline_access lets Hearth check every ten minutes that each person may still sign in (see Ending access).
  6. Check the Claims: Username (preferred_username), Email (email), Name (name) and Groups (groups). Change them if your provider uses other names.
  7. 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:

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:

  1. 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.
  2. Under Authentication, set Front-channel logout URL to Hearth's Front-channel logout URL. Leave ID tokens and Access tokens (the implicit flow) off.
  3. 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.
  4. Under Token configuration, select Add optional claim, token type ID, and add email, xms_edov, verified_primary_email and verified_secondary_email. Accept adding the Microsoft Graph email permission when asked.
  5. 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.
  6. Under API permissions, check that Microsoft Graph has the delegated permissions openid, profile, email and offline_access, and select Grant admin consent.
  7. On the Overview, copy the Application (client) ID into Hearth's Client ID and the Directory (tenant) ID into Tenant ID.
  8. 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:

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

  1. Choose SAML 2.0 under Provider. Hearth suggests the attributes uid, mail, displayName and groups; AD FS and Entra name theirs by URI, so change them to match.
  2. 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.
  3. 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.
  4. 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.
  5. 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:

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.

  1. Under Administration, Sign-in, Provisioning (SCIM), turn on Accounts and groups from the directory.
  2. Copy the SCIM address (https://hearth.example.org/api/v1/scim/v2).
  3. 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.
  4. 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:

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