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
Setting up a provider
- Set the Site URL under Control panel › General first.
- Open Control panel › Single sign-on and choose the provider. The page shows a redirect address to copy.
- Register ThirtyFile with the provider (see below) and paste that address there.
- 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 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:
| Rule | What happens |
|---|---|
| Linked accounts only | Only people who linked the account themselves, from their account menu |
| Match existing users by email | People 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 automatically | Anyone 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.
Linking an account yourself
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.
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:
- Address.
ldaps://dc.example.com(secure from the first byte), orldap://dc.example.comwith Use StartTLS. Without StartTLS the connection is unencrypted and only allowed to a directory on the private network. When the directory's certificate was made by an authority of your own, paste that authority's certificate (PEM). - Service account. An account that may search the directory. Its password is stored encrypted with the server's key and never sent back to the page. It only finds people: their passwords are checked by signing in as them.
- People. The search base, a filter with
{username}standing for what the person typed, and the attributes that hold the stable id (what an account is linked by, so a rename in the directory doesn't make a second account), the user name, the name and the email address. - Groups. Found from the person's own
memberOfvalues, or by searching the groups that have the person as a member (a filter with{dn}; in Active Directory,(member:1.2.840.113556.1.4.1941:={dn})also follows groups inside groups). You can require a group for signing in, and choose which directory groups the groups here follow.
| Directory | People's filter | Stable id | User name | Groups |
|---|---|---|---|---|
| Active Directory | (&(objectClass=user)(objectCategory=person)(|(sAMAccountName={username})(userPrincipalName={username}))) | objectGUID | sAMAccountName | memberOf |
| OpenLDAP | (&(objectClass=inetOrgPerson)(uid={username})) | entryUUID | uid | (&(objectClass=groupOfNames)(member={dn})) |
| FreeIPA | (&(objectClass=posixAccount)(uid={username})) | ipaUniqueID | uid | memberOf |
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
- A user name that has no account made here is looked up in the directory, and the password is checked by binding as that person. It is never stored or logged. Accounts made by hand (the first administrator, accounts an administrator created) keep their own passwords and never go to the directory.
- The account is created at the first sign-in (turn that off to link only accounts that exist), with a personal space as for single sign-on, and linked by the directory's stable id.
- Failed attempts are limited like passwords, and since every guess is a bind at the directory, a name is paused after five wrong passwords within 15 minutes, from any address, before the directory's own lockout could be reached by guessing. A directory that can't be reached is told as such, isn't counted as a wrong password, and sends an administrator alert once it begins and once it is over. If passwords are turned off for someone, so is their directory password. Two-factor sign-in and passkeys apply on top when an administrator requires them. SFTP, WebDAV, FTP and S3 keep using app passwords and keys, never the directory password.
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.
*)(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:
| Choice | What happens |
|---|---|
| Everyone | As before: a password or a provider |
| Administrators only | The 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 |
| Nobody | Everyone 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.
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.