triauth for ForgejoOIDC
Let your team sign in to your Forgejo with one approval on their own device, and no Forgejo passwords.
- Sign-in through
- OpenID Connect bridge
- Available in
- Every Forgejo installation
- Set up in
- Site administration › Identity & access › Authentication sources
About Forgejo
Forgejo is self-hosted software for keeping source code, tracking issues, and reviewing changes, run on your own server. It is developed by an independent community and is the software behind Codeberg.
Connect Forgejo to triauth
Forgejo signs people in through the triauth OpenID Connect bridge. Once connected, Forgejo's sign-in page shows a Sign in with triauth button. People on your team click it, type their username, and approve on their own device. Nobody keeps a Forgejo password, and when someone leaves, removing their identity records at your domain ends their access to Forgejo as well.
How it works
- In Forgejo, 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 Forgejo's redirect address,
https://forgejo.example.com/user/oauth2/triauth/callbackwith your own Forgejo address in place offorgejo.example.com, and click Connect app. The bridge gives you a client ID and a client secret. - Back in Forgejo, 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 addprofile email groupsas additional scopes. Save the source. - Open Forgejo's sign-in page and click Sign in with triauth.
Checkpoint
Forgejo's sign-in page shows a Sign in with triauth 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
- The name you give the source becomes part of the redirect address and of the button, so pick it before you connect the app on the bridge.
- By default, a person who signs in for the first time is asked to register or to connect an existing Forgejo account with its password. If new people should get an account at once, the person who connects the app turns on automatic registration.
- Forgejo 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-forgejo>/user/oauth2/<source name>/callback |
| Where in Forgejo | 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 | profile email groups, since Forgejo 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 |
Forgejo keeps the client secret, so leave This app can't keep a secret unticked when you connect it on the bridge. Forgejo's OIDC group mappings guide and the configuration cheat sheet explain the fields.
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 Forgejo organizations.
- Read Forgejo's OIDC group mappings guide for every mapping Forgejo 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.