Skip to content

Conversation

@francescocaponio
Copy link

About this PR

Tries to implement the request in #4602 and #7437

With the help of Copilot, we added the support for OIDC authentication.

The OIDC parameters are edited in the admin section, stored in the DB. It is possible to select if the OIDC authentication method is the only available or coexists with other authentication methods in the login form.

The oidc authentication backend is based on the go-oidc module.

It supports auto-discovery of the auth endpoints via the .well-known mechanism.

The login button can be customized with a custom icon (loaded from a user specified url), background color and text color.

It supports the oidc groups claim and the user can specify the name of a group where users who belongs to this group are automatically elevated to admin roles in gogs.

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have read and acknowledge the Contributing guide.
  • I have added test cases to cover the new code or have provided the test plan.
  • I have tested the behavior of the code with a OpenID Connect Identity Provider.

Test plan

I'm attaching some screenshots of the configuration and login forms:

Authentication sources list:

image

New/edit auth source form:

image

Login form (OIDC as default login source):

image

Login form (OIDC not as default login source):

image

Copilot AI and others added 14 commits September 17, 2025 14:41
Co-authored-by: francescocaponio <66728654+francescocaponio@users.noreply.github.com>
Co-authored-by: francescocaponio <66728654+francescocaponio@users.noreply.github.com>
Co-authored-by: francescocaponio <66728654+francescocaponio@users.noreply.github.com>
…alidation

Co-authored-by: francescocaponio <66728654+francescocaponio@users.noreply.github.com>
Co-authored-by: francescocaponio <66728654+francescocaponio@users.noreply.github.com>
Co-authored-by: francescocaponio <66728654+francescocaponio@users.noreply.github.com>
Co-authored-by: francescocaponio <66728654+francescocaponio@users.noreply.github.com>
Co-authored-by: francescocaponio <66728654+francescocaponio@users.noreply.github.com>
Co-authored-by: francescocaponio <66728654+francescocaponio@users.noreply.github.com>
…-4c65-b083-8b2862842437

Implement OIDC (OpenID Connect) authentication support with OIDC-only login mode, group-based admin assignment, and customizable button styling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant