[PR #5378] [MERGED] Integrate OAuth2 Provider #17772

Closed
opened 2025-11-02 15:39:39 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/5378
Author: @jonasfranz
Created: 11/22/2018
Status: Merged
Merged: 3/8/2019
Merged by: @techknowlogick

Base: masterHead: feature/oauth2


📝 Commits (10+)

  • fb1bab1 Add oauth2 application
  • 8b9fb4c Update index.css
  • 4b18995 Merge remote-tracking branch 'origin/master' into feature/oauth2
  • 8a2e6f1 Add grant and redirection
  • 6752e1a Small improvements
  • ee833d1 Add documentation and missing vendors
  • 114cf36 Merge branch 'master' into feature/oauth2
  • cabbbd9 Revert unwanted changes
  • 6c5ddfb Merge remote-tracking branch 'origin/master' into feature/oauth2
  • ccb990a Merge branch 'feature/oauth2' of github.com:JonasFranzDEV/gitea into feature/oauth2

📊 Changes

37 files changed (+2667 additions, -11 deletions)

View changed files

📝 Gopkg.lock (+4 -1)
📝 cmd/generate.go (+1 -1)
📝 custom/conf/app.ini.sample (+10 -0)
📝 docs/content/doc/advanced/config-cheat-sheet.en-us.md (+7 -0)
integrations/oauth_test.go (+138 -0)
📝 models/error.go (+39 -0)
models/fixtures/oauth2_application.yml (+9 -0)
models/fixtures/oauth2_authorization_code.yml (+8 -0)
models/fixtures/oauth2_grant.yml (+6 -0)
📝 models/models.go (+3 -0)
models/oauth2_application.go (+457 -0)
models/oauth2_application_test.go (+209 -0)
📝 models/user.go (+1 -0)
📝 modules/auth/auth.go (+32 -1)
📝 modules/auth/user_form.go (+59 -0)
📝 modules/generate/generate.go (+3 -5)
modules/secret/secret.go (+33 -0)
modules/secret/secret_test.go (+22 -0)
📝 modules/setting/setting.go (+48 -1)
📝 options/locale/locale_en-US.ini (+32 -0)

...and 17 more files

📄 Description

I'm currently integrating an OAuth2 Provider in Gitea. I'm using RFC 6749 as model. Currently only the Authorization Code Flow gets implemented due to security concerns for the other flows. I also plan to implement the PKCE Extension to support mobile and "serverless" clients.

Scopes is not a part of this PR and will be integrated until scopes are implemented in general.

I'm open for contributions and feedback. The current code is not final and is absolutely subject to change.

Resolves #27.

TODO:

  • Database Structure
  • Authorization Endpoint
  • Access Token Endpoint
  • Access Token validation (middleware)
  • Refresh Tokens
  • PKCE
  • Application Settings UI
  • Authorize UI (just basic UI, @kolaente will improve it)
  • Well known routes will be implemented in another PR
  • Tests, Tests, Tests, Tests
  • ....

🔄 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/5378 **Author:** [@jonasfranz](https://github.com/jonasfranz) **Created:** 11/22/2018 **Status:** ✅ Merged **Merged:** 3/8/2019 **Merged by:** [@techknowlogick](https://github.com/techknowlogick) **Base:** `master` ← **Head:** `feature/oauth2` --- ### 📝 Commits (10+) - [`fb1bab1`](https://github.com/go-gitea/gitea/commit/fb1bab1d9f2d09886fb94ce26c1aa2c0b4a853bb) Add oauth2 application - [`8b9fb4c`](https://github.com/go-gitea/gitea/commit/8b9fb4ca59fc4becc841769b76a3f53e7a95d1e5) Update index.css - [`4b18995`](https://github.com/go-gitea/gitea/commit/4b18995a0e3d6ee2dbae2ee8c1a2c04f35603540) Merge remote-tracking branch 'origin/master' into feature/oauth2 - [`8a2e6f1`](https://github.com/go-gitea/gitea/commit/8a2e6f1c0ec93b7cade2465119012069d1b54c17) Add grant and redirection - [`6752e1a`](https://github.com/go-gitea/gitea/commit/6752e1a4d2638572187267c82ab382cd231b00fd) Small improvements - [`ee833d1`](https://github.com/go-gitea/gitea/commit/ee833d1dc326e192b82dd853b5b49506d3d25696) Add documentation and missing vendors - [`114cf36`](https://github.com/go-gitea/gitea/commit/114cf367dddcf8723f124afba9205a134dca4f58) Merge branch 'master' into feature/oauth2 - [`cabbbd9`](https://github.com/go-gitea/gitea/commit/cabbbd9b1c2df43577f748daa210163927721174) Revert unwanted changes - [`6c5ddfb`](https://github.com/go-gitea/gitea/commit/6c5ddfb431167f3241e53124456484c8c18af842) Merge remote-tracking branch 'origin/master' into feature/oauth2 - [`ccb990a`](https://github.com/go-gitea/gitea/commit/ccb990a2e13b52e419066102587e299de05bf88f) Merge branch 'feature/oauth2' of github.com:JonasFranzDEV/gitea into feature/oauth2 ### 📊 Changes **37 files changed** (+2667 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `Gopkg.lock` (+4 -1) 📝 `cmd/generate.go` (+1 -1) 📝 `custom/conf/app.ini.sample` (+10 -0) 📝 `docs/content/doc/advanced/config-cheat-sheet.en-us.md` (+7 -0) ➕ `integrations/oauth_test.go` (+138 -0) 📝 `models/error.go` (+39 -0) ➕ `models/fixtures/oauth2_application.yml` (+9 -0) ➕ `models/fixtures/oauth2_authorization_code.yml` (+8 -0) ➕ `models/fixtures/oauth2_grant.yml` (+6 -0) 📝 `models/models.go` (+3 -0) ➕ `models/oauth2_application.go` (+457 -0) ➕ `models/oauth2_application_test.go` (+209 -0) 📝 `models/user.go` (+1 -0) 📝 `modules/auth/auth.go` (+32 -1) 📝 `modules/auth/user_form.go` (+59 -0) 📝 `modules/generate/generate.go` (+3 -5) ➕ `modules/secret/secret.go` (+33 -0) ➕ `modules/secret/secret_test.go` (+22 -0) 📝 `modules/setting/setting.go` (+48 -1) 📝 `options/locale/locale_en-US.ini` (+32 -0) _...and 17 more files_ </details> ### 📄 Description I'm currently integrating an OAuth2 Provider in Gitea. I'm using [RFC 6749](https://tools.ietf.org/html/rfc6749) as model. Currently only the [Authorization Code Flow](https://tools.ietf.org/html/rfc6749#section-1.3.1) gets implemented due to security concerns for the other flows. I also plan to implement the [PKCE Extension](https://tools.ietf.org/html/rfc7636) to support mobile and "serverless" clients. Scopes is not a part of this PR and will be integrated until scopes are implemented in general. I'm open for contributions and feedback. The current code is not final and is absolutely subject to change. Resolves #27. TODO: - [x] Database Structure - [x] Authorization Endpoint - [x] Access Token Endpoint - [x] Access Token validation (middleware) - [x] Refresh Tokens - [x] PKCE - [x] Application Settings UI - [x] Authorize UI (just basic UI, @kolaente will improve it) - [x] ~~Well known routes~~ will be implemented in another PR - [x] Tests, Tests, Tests, Tests - .... --- <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 15:39:39 -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#17772