Skip to content

Commit

Permalink
Add Forgejo oidc provider config example (#17872)
Browse files Browse the repository at this point in the history
  • Loading branch information
choucavalier authored Nov 20, 2024
1 parent 573bdbc commit 80e39fd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/17872.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add OIDC example configuration for Forgejo (fork of Gitea).
30 changes: 30 additions & 0 deletions docs/openid.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,36 @@ but it has a `response_types_supported` which excludes "code" (which we rely on,
is even mentioned in their [documentation](https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow#login)),
so we have to disable discovery and configure the URIs manually.

### Forgejo

Forgejo is a fork of Gitea that can act as an OAuth2 provider.

The implementation of OAuth2 is improved compared to Gitea, as it provides a correctly defined `subject_claim` and `scopes`.

Synapse config:

```yaml
oidc_providers:
- idp_id: forgejo
idp_name: Forgejo
discover: false
issuer: "https://your-forgejo.com/"
client_id: "your-client-id" # TO BE FILLED
client_secret: "your-client-secret" # TO BE FILLED
client_auth_method: client_secret_post
scopes: ["openid", "profile", "email", "groups"]
authorization_endpoint: "https://your-forgejo.com/login/oauth/authorize"
token_endpoint: "https://your-forgejo.com/login/oauth/access_token"
userinfo_endpoint: "https://your-forgejo.com/api/v1/user"
user_mapping_provider:
config:
subject_claim: "sub"
picture_claim: "picture"
localpart_template: "{{ user.preferred_username }}"
display_name_template: "{{ user.name }}"
email_template: "{{ user.email }}"
```

### GitHub

[GitHub][github-idp] is a bit special as it is not an OpenID Connect compliant provider, but
Expand Down

0 comments on commit 80e39fd

Please sign in to comment.