triauth for SeafileOIDC
Let your team open their Seafile libraries with one approval on their own device, and no Seafile passwords.
- Sign-in through
- OpenID Connect bridge
- Available in
- The Community and Professional Editions
- Set up in
seahub_settings.py
About Seafile
Seafile is a file sync and share server, in the style of a self-hosted Dropbox. People keep files in libraries, sync them to their computers and phones, and share links, while the organization keeps the files on its own servers.
Connect Seafile to triauth
Seafile signs people in through the triauth OpenID Connect bridge, set up as its OAuth login. Once connected, the login page shows a Single Sign-On button. People on your team click it, type their username, and approve on their own device. Nobody keeps a Seafile password, and when someone leaves, removing their identity records at your domain ends their access to Seafile as well.
How it works
Open oidc.triauth.org and enter your domain. Paste Seafile's redirect address,
https://files.example.com/oauth/callback/with your own Seafile address in place offiles.example.com, and click Connect app. The bridge gives you a client ID and a client secret.On your server, add the settings below to
seahub_settings.pyand restart Seahub. Replaceexample.comwith your domain,files.example.comwith your Seafile address, and the two placeholders with the client ID and the client secret from the bridge.pythonENABLE_OAUTH = True OAUTH_PROVIDER = "example.com" OAUTH_CLIENT_ID = "<client ID from the bridge>" OAUTH_CLIENT_SECRET = "<client secret from the bridge>" OAUTH_REDIRECT_URL = "https://files.example.com/oauth/callback/" OAUTH_AUTHORIZATION_URL = "https://oidc.triauth.org/example.com/authorize" OAUTH_TOKEN_URL = "https://oidc.triauth.org/example.com/token" OAUTH_USER_INFO_URL = "https://oidc.triauth.org/example.com/userinfo" OAUTH_SCOPE = ["openid", "profile", "email"] OAUTH_ATTRIBUTE_MAP = { "sub": (True, "uid"), "email": (False, "email"), "name": (False, "name"), }Open Seafile's login page and click Single Sign-On.
Checkpoint
Seafile's login page shows a Single Sign-On button. Choosing it opens a page from the bridge that asks for the username, and the person's authenticator asks them to approve.
Good to know
- Everyone with an identity at your domain gets a Seafile account the first time they sign in, active at once. To let only one team in, limit the app to a group when you connect it.
- Seafile knows a person by the identity it received, so an account made with a password is not matched by email address. A signed-in person can connect the two from their profile.
- Groups and library access are managed in Seafile. The groups published at your domain are not used.
For the person who connects the app
| Setting | Value |
|---|---|
| Redirect address | https://<your-seafile>/oauth/callback/, with the trailing slash, also set as OAUTH_REDIRECT_URL |
| Where in Seafile | seahub_settings.py, then a restart of Seahub |
| Addresses | the authorization, token, and userinfo addresses go in one by one, as above, since Seafile does not read the discovery document |
| Attribute map | sub to uid is required. email and name fill the profile |
| New accounts | OAUTH_CREATE_UNKNOWN_USER and OAUTH_ACTIVATE_USER_AFTER_CREATION, both on by default |
Seafile keeps the client secret, so leave This app can't keep a secret unticked when you connect it on the bridge. Seafile's OAuth guide explains every setting.
Next steps
- Read the OpenID Connect bridge page for what every connected app gets and what the bridge keeps private.
- Read Roll out to your team to give everyone in your organization an identifier at your domain.
- Read Groups to limit Seafile to one team when you connect it.
- Read Seafile's OAuth guide for every setting Seafile offers.
All logos and trademarks belong to their respective owners and do not imply affiliation or endorsement of the organization or product by triauth, nor vice versa. The content provided on this page may include information from third-party sources. We do not assume any responsibility for the completeness, correctness, or applicability of the information. You should independently verify any details before relying on them.
