Single sign-on

Let people sign in with the Microsoft, Google or GitHub account they already have, or through your own identity provider (OpenID Connect).

On this page
  1. Setting up a provider
  2. Who may sign in
  3. Different settings for different domains
  4. Linking an account yourself
  5. Directory sign-in: LDAP and Active Directory
  6. Turning off passwords
  7. Microsoft tenants with guests
  8. Create guests with single sign-on

Setting up a provider

  1. Set the Site URL under Control panel › General first.
  2. Open Control panel › Single sign-on and choose the provider. The page shows a redirect address to copy.
  3. Register ThirtyFile with the provider (see below) and paste that address there.
  4. Copy the ID and secret the provider gives you into ThirtyFile, switch the provider on and save.

Microsoft Entra ID

Microsoft Entra admin center › App registrations › New registration. Select the "Web" platform and enter the redirect address, then add a client secret under "Certificates & secrets". The application ID and tenant ID are on the "Overview" page.

Google

Google Cloud Console › APIs & Services › Credentials › Create credentials › OAuth client ID. Choose "Web application" and add the redirect address under "Authorized redirect URIs".

GitHub

GitHub › Settings › Developer settings › OAuth Apps › New OAuth App. Enter the redirect address as the callback URL, then generate a client secret.

OpenID Connect (Keycloak, Authentik, Authelia, Zitadel…)

Create a confidential client (a web application) in your identity provider with the redirect address, and note its client ID and secret. In ThirtyFile, enter the Issuer URL (for Keycloak, https://auth.example.com/realms/<realm>) and a name for the sign-in button, such as "Company login". When you save, ThirtyFile reads the provider's settings from <issuer>/.well-known/openid-configuration; the issuer must be an https address, and the document must name the same issuer.

The provider must include the person's email address and mark it as verified (the email scope and claim, and email_verified), otherwise people can only link the account themselves. Allowed domains, domain rules, linking and automatic accounts work as with the other providers.

Who may sign in

Each provider has its own rule for people who sign in for the first time:

RuleWhat happens
Linked accounts onlyOnly people who linked the account themselves, from their account menu
Match existing users by emailPeople whose email is the username of an account without a password or two-factor sign-in, such as one single sign-on created for that same email. An account that has either, like one an administrator created, isn't matched, because signing in through the provider would skip them: its owner signs in with the password once and links the account
Create accounts automaticallyAnyone from an allowed email domain gets a new account

With automatic accounts, list the allowed email domains, for example example.com, so that only your own people get in.

Different settings for different domains

Rules by email domain give new accounts their own permissions, space size and groups. For example, partners from partner.example can get a smaller space and no permission to share.

A rule can also decide whether new accounts get a personal space, My files, and on which storage location. Left as As in the system settings, they follow Control panel › General. When the location's folder isn't available, the person still gets in, and their "My files" is created there once it is back.

Anyone can link or unlink an account of each provider set up here (Microsoft, Google, GitHub or OpenID Connect) under Account menu › Sign-in methods. A linked account signs in without the password, so linking asks for the current password first, and with two-factor sign-in a code; accounts without a password link within 10 minutes of signing in. The person gets a notification, in the app and by email, for every account linked to theirs, including one matched by email.

When a list of allowed domains is set, only an account whose email address the provider verified, in one of those domains, can be linked. Only verified addresses are kept with a linked account.

An account created by single sign-on has no password. Its last linked account can only be removed after an administrator gave it a password. When an administrator sets a new password for someone, their linked accounts are removed too: they link them again after signing in.

Directory sign-in: LDAP and Active Directory

When your people are kept in Active Directory, OpenLDAP or FreeIPA and you have no OpenID provider, they can sign in with their directory password, and their accounts and groups follow the directory. Open Control panel › Directory sign-in, choose a kind of directory to start from, and fill in:

DirectoryPeople's filterStable idUser nameGroups
Active Directory(&(objectClass=user)(objectCategory=person)(|(sAMAccountName={username})(userPrincipalName={username})))objectGUIDsAMAccountNamememberOf
OpenLDAP(&(objectClass=inetOrgPerson)(uid={username}))entryUUIDuid(&(objectClass=groupOfNames)(member={dn}))
FreeIPA(&(objectClass=posixAccount)(uid={username}))ipaUniqueIDuidmemberOf

The Test button tries what is typed, before it is saved: the connection (with the certificate's problem in words: an authority that isn't trusted, a name that doesn't fit, an expired certificate), the service account, then, for a user name you give, the person with what was found in the attributes, and their groups. It stops at the first thing that goes wrong, with the directory's own reason.

When people sign in

When someone leaves

Every 15 minutes, and when you press Sync now, groups follow the directory, and a person who is gone from the directory, or turned off there (an Active Directory account with the disabled flag, a FreeIPA or 389 lock), has their account turned off and their sessions ended. Accounts are never deleted and their files stay. When the person is back, the account is turned on again; one an administrator turned off stays off. A search that finds no one turns nobody off, since a wrong search base is the likelier reason. People of the directory who are in a group that follows it can't be changed by hand in Control panel › Groups.

The user name is only ever put into the filter as a value: a name like *)(uid=* finds nobody. A search that finds more than one entry for a name is refused, referrals are not followed, and every search has a time and a size limit.

Turning off passwords

Once single sign-on works, you can stop people from signing in with a user name and password at all, so that your identity provider's rules (multi-factor sign-in, who may leave the company) apply to everyone. Choose under Control panel › Single sign-on › Password sign-in:

ChoiceWhat happens
EveryoneAs before: a password or a provider
Administrators onlyThe sign-in page has no user name or password field, only the providers. Administrators sign in with a password at /sign-in/administrator of your site, an address no page links to. It is the way back in when the provider is down or set up wrongly
NobodyEveryone signs in through a provider, administrators too, and no page offers a password

Before it can be saved, at least one enabled administrator must be linked to a provider that is on, and you must be one of them. For Nobody you must also have signed in through the provider once, so a wrong setup is found now. The page lists these administrators. As long as passwords are off, the last such administrator can't be disabled, deleted, made a standard user or unlinked, and the last provider can't be turned off: ThirtyFile refuses, saying why. An administrator resetting a person's password removes their linked accounts (see above), which is refused for the same reason when it would leave nobody.

What changes: signing in with a password, the second step of a sign-in begun with a password, resetting a password by email (the link isn't offered and links already sent stop working) and changing a password. What doesn't: app passwords, API tokens, SFTP keys, S3 keys and FTP device passwords, which people make after signing in and which keep working until the account is disabled or deleted. Sessions that are already open stay open. Passkeys follow the same choice, because ThirtyFile keeps them like passwords: where passwords are off for someone, their passkeys don't sign them in either, and the page doesn't offer one, so the identity provider's rules apply.

If the provider stops working and nobody can sign in, run this on the server. It takes effect at once, with no restart:
docker exec thirtyfile thirtyfile password-sign-in everyone
The other choices are administrators and nobody. ThirtyFile also logs a warning at start while passwords are not open to everyone.

Microsoft tenants with guests

With a tenant ID set, the members of your tenant are matched by email. Guests from other organisations sign in through your tenant too, but their email address comes from their own organisation, which can enter any address. So a guest's email doesn't match or create an account: guests sign in with a password and link their Microsoft account themselves.

To match guests by email as well, add the optional claim xms_edov to the ID token: in the app registration, Token configuration › Add optional claim › ID › xms_edov. Microsoft then says when the domain of a guest's email address belongs to their organisation, and only those guests are matched.

Create guests with single sign-on

Choose Create guest accounts in a provider’s new-account defaults, or enable Guest account in an email-domain rule. The matching domain rule takes precedence over the provider defaults. Guests are created without My files, regardless of the normal personal-space setting. Configured groups must have guest-compatible roles and end dates; unsafe membership is rejected without creating a partial account. These defaults apply to newly created accounts, and do not convert accounts already linked to the provider. Convert an existing account from the Users page after reviewing its access.