triauth for GiteaOIDC
Let your team sign in to your Gitea with one approval on their own device, and no Gitea passwords.
- Sign-in through
- OpenID Connect bridge
- Available in
- All editions
- Set up in
- Site Administration › Identity & Access › Authentication Sources
About Gitea
Gitea is a light and fast home for a team's code, with code review, an issue tracker, and automated builds, that runs on a small server of your own. Many teams choose it as a self-hosted alternative to GitHub.
Connect Gitea to triauth
Gitea signs people in through the triauth OpenID Connect bridge. Once connected, Gitea's sign-in page shows a button for triauth. People on your team click it, type their username, and approve on their own device. Nobody keeps a Gitea password, and when someone leaves, removing their identity records at your domain ends their access to Gitea as well.
How it works
- In Gitea, open Site Administration › Identity & Access › Authentication Sources and add a source of the type OAuth2 with the provider OpenID Connect. Name it
triauth. - Open oidc.triauth.org and enter your domain. Paste Gitea's redirect address,
https://gitea.example.com/user/oauth2/triauth/callbackwith your own Gitea address in place ofgitea.example.com, and click Connect app. - Back in Gitea, paste the client ID and the client secret. As the auto discovery URL, enter
https://oidc.triauth.org/example.com/.well-known/openid-configurationwith your domain in place ofexample.com, and addemail profile groupsas additional scopes. Save the source. - Open Gitea's sign-in page and click the new button.
Checkpoint
Gitea's sign-in page shows a new sign-in button named after the source. 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
- The name you give the source becomes part of the redirect address, so pick it before you connect the app on the bridge.
- By default, a person who signs in for the first time links an existing Gitea account. If new people should get an account at their first sign-in, the person who connects the app turns on automatic registration.
- Gitea can give admin rights, or membership of organization teams, by the groups published at your domain.
For the person who connects the app
| Setting | Value |
|---|---|
| Redirect address | https://<your-gitea>/user/oauth2/<source name>/callback |
| Where in Gitea | Site Administration › Identity & Access › Authentication Sources › Add Authentication Source, type OAuth2, provider OpenID Connect |
| Discovery URL | https://oidc.triauth.org/<your domain>/.well-known/openid-configuration |
| Additional scopes | email profile groups, since Gitea adds only openid by itself |
| Groups | "Claim name providing group names" is groups, then the admin and restricted group values and the team map |
| New accounts | ENABLE_AUTO_REGISTRATION in the [oauth2_client] section of app.ini. New usernames come from preferred_username, the person's username, through the default USERNAME = nickname |
Gitea keeps the client secret, so leave This app can't keep a secret unticked when you connect it on the bridge. Gitea's authentication guide and the configuration cheat sheet explain every field.
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 publish teams and map them to Gitea organizations.
- Read Gitea's authentication guide for every setting Gitea 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.