3.3 KiB
3.3 KiB
title | description | lead | date | draft | images | menu | weight | toc | community | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Gitea | Integrating Gitea with the Authelia OpenID Connect Provider. | 2022-07-01T13:07:02+10:00 | false |
|
620 | true | true |
Tested Versions
Before You Begin
{{% oidc-common %}}
Assumptions
This example makes the following assumptions:
- Application Root URL:
https://gitea.example.com
- Authelia Root URL:
https://auth.example.com
- Client ID:
gitea
- Client Secret:
insecure_secret
- Authentication Name (Gitea):
authelia
:- This option determines the redirect URI in the format of
https://gitea.example.com/user/oauth2/<Authentication Name>/callback
. This means if you change this value you need to update the redirect URI.
- This option determines the redirect URI in the format of
Configuration
Application
To configure Gitea to utilize Authelia as an OpenID Connect 1.0 Provider:
- Expand User Options
- Visit Site Administration
- Visit Authentication Sources
- Visit Add Authentication Source
- Configure:
- Authentication Name:
authelia
- OAuth2 Provider:
OpenID Connect
- Client ID (Key):
gitea
- Client Secret:
insecure_secret
- OpenID Connect Auto Discovery URL:
https://auth.example.com/.well-known/openid-configuration
- Authentication Name:
{{< figure src="gitea.png" alt="Gitea" width="300" >}}
To configure Gitea to perform automatic user creation for the auth.example.com
domain via OpenID Connect 1.0:
- Edit the following values in the Gitea
app.ini
:
[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = true
WHITELISTED_URIS = auth.example.com
[service]
DISABLE_REGISTRATION = false
ALLOW_ONLY_EXTERNAL_REGISTRATION = true
SHOW_REGISTRATION_BUTTON = false
Take a look at the See Also section for the cheatsheets corresponding to the sections above for their descriptions.
Authelia
The following YAML configuration is an example Authelia client configuration for use with Gitea which will operate with the above example:
identity_providers:
oidc:
## The other portions of the mandatory OpenID Connect 1.0 configuration go here.
## See: https://www.authelia.com/c/oidc
clients:
- id: 'gitea'
description: 'Gitea'
secret: '$pbkdf2-sha512$310000$c8p78n7pUMln0jzvd4aK4Q$JNRBzwAo0ek5qKn50cFzzvE9RXV88h1wJn5KGiHrD0YKtZaR/nCb2CJPOsKaPK0hjf.9yHxzQGZziziccp6Yng' # The digest of 'insecure_secret'.
public: false
authorization_policy: 'two_factor'
redirect_uris:
- 'https://gitea.example.com/user/oauth2/authelia/callback'
scopes:
- 'openid'
- 'email'
- 'profile'
userinfo_signing_algorithm: 'none'
See Also
- Gitea app.ini Config Cheat Sheet: