[PR #5123] [MERGED] OAuth2 auto-register #17655

Closed
opened 2025-11-02 14:47:09 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/5123
Author: @mgjm
Created: 10/19/2018
Status: Merged
Merged: 4/14/2021
Merged by: @6543

Base: masterHead: oauth2-auto-register


📝 Commits (10+)

  • a3366c4 Refactored handleOAuth2SignIn in routers/user/auth.go
  • 6e2ece4 Refactored user creation
  • a473815 Added auto-register for OAuth2 users
  • a700b02 Moved oauth2 settings to new section in app.ini
  • f0124c4 Added oauth2 use nickname setting
  • 9504a74 Merge branch 'master' into oauth2-auto-register
  • 688afbd Merge branch 'master' into oauth2-auto-register
  • aeb833c Moved oauth2_client settings to service file
  • 527c7e6 Updated comments on auth helpers
  • 6a3a0e7 Renamed oauth2_client settings

📊 Changes

9 files changed (+351 additions, -135 deletions)

View changed files

📝 custom/conf/app.example.ini (+24 -0)
📝 docs/content/doc/advanced/config-cheat-sheet.en-us.md (+15 -0)
📝 models/migrations/migrations.go (+2 -0)
models/migrations/v179.go (+26 -0)
📝 modules/auth/oauth2/oauth2.go (+11 -3)
modules/setting/oauth2_client.go (+90 -0)
📝 modules/setting/setting.go (+1 -0)
📝 routers/user/auth.go (+178 -84)
📝 routers/user/auth_openid.go (+4 -48)

📄 Description

Changes

  • Refactored user creation (code deduplication, see individual commit messages: a3366c4 and
    6e2ece4)
  • Added auto-registration for OAuth2 users

Settings

A new settings section (oauth2_client) is added and documented in custom/conf/app.ini.sample and content/doc/advanced/config-cheat-sheet.en-us.md.

Breaking changes?

No. The default settings reflect the current behaviour. And OAuth2 auto-register needs to be manually enabled.

Referenced Issues

Implements #3520 und solves the secondary consideration in #1036.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/5123 **Author:** [@mgjm](https://github.com/mgjm) **Created:** 10/19/2018 **Status:** ✅ Merged **Merged:** 4/14/2021 **Merged by:** [@6543](https://github.com/6543) **Base:** `master` ← **Head:** `oauth2-auto-register` --- ### 📝 Commits (10+) - [`a3366c4`](https://github.com/go-gitea/gitea/commit/a3366c4ffa3825bd0353bcd77e9484ec7fc9056a) Refactored handleOAuth2SignIn in routers/user/auth.go - [`6e2ece4`](https://github.com/go-gitea/gitea/commit/6e2ece448ec9684d4b1e3198c49b82c40a9935ad) Refactored user creation - [`a473815`](https://github.com/go-gitea/gitea/commit/a4738154289e082742bbea194c8d29d225a8f15e) Added auto-register for OAuth2 users - [`a700b02`](https://github.com/go-gitea/gitea/commit/a700b02415f5b9ac89ae2a48924042e6a69f9630) Moved oauth2 settings to new section in app.ini - [`f0124c4`](https://github.com/go-gitea/gitea/commit/f0124c48de1aab6890151dbcc9282b283173e0f4) Added oauth2 use nickname setting - [`9504a74`](https://github.com/go-gitea/gitea/commit/9504a74191738e66cd00ec739ba0a397d44b8f85) Merge branch 'master' into oauth2-auto-register - [`688afbd`](https://github.com/go-gitea/gitea/commit/688afbd1efb6977582ba1fa0445fb4cd28491c47) Merge branch 'master' into oauth2-auto-register - [`aeb833c`](https://github.com/go-gitea/gitea/commit/aeb833c9ad408efdad3cf4fe1fd9e9d997b7f0a8) Moved oauth2_client settings to service file - [`527c7e6`](https://github.com/go-gitea/gitea/commit/527c7e61d945bb4dad487e7e5efefd736aee4201) Updated comments on auth helpers - [`6a3a0e7`](https://github.com/go-gitea/gitea/commit/6a3a0e7c0b11e425210720b396720a0d9b3e2349) Renamed oauth2_client settings ### 📊 Changes **9 files changed** (+351 additions, -135 deletions) <details> <summary>View changed files</summary> 📝 `custom/conf/app.example.ini` (+24 -0) 📝 `docs/content/doc/advanced/config-cheat-sheet.en-us.md` (+15 -0) 📝 `models/migrations/migrations.go` (+2 -0) ➕ `models/migrations/v179.go` (+26 -0) 📝 `modules/auth/oauth2/oauth2.go` (+11 -3) ➕ `modules/setting/oauth2_client.go` (+90 -0) 📝 `modules/setting/setting.go` (+1 -0) 📝 `routers/user/auth.go` (+178 -84) 📝 `routers/user/auth_openid.go` (+4 -48) </details> ### 📄 Description ## Changes - Refactored user creation (code deduplication, see individual commit messages: a3366c4 and 6e2ece4) - Added auto-registration for OAuth2 users ## Settings A new settings section (`oauth2_client`) is added and documented in `custom/conf/app.ini.sample` and `content/doc/advanced/config-cheat-sheet.en-us.md`. ## Breaking changes? **No**. The default settings reflect the current behaviour. And OAuth2 auto-register needs to be manually enabled. ## Referenced Issues Implements #3520 und solves the secondary consideration in #1036. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 14:47:10 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#17655