forgejo/routers
Johnny Oskarsson a07e67d9cc
Minimal OpenID Connect implementation (#14139)
This is "minimal" in the sense that only the Authorization Code Flow
from OpenID Connect Core is implemented.  No discovery, no configuration
endpoint, and no user scope management.

OpenID Connect is an extension to the (already implemented) OAuth 2.0
protocol, and essentially an `id_token` JWT is added to the access token
endpoint response when using the Authorization Code Flow.  I also added
support for the "nonce" field since it is required to be used in the
id_token if the client decides to include it in its initial request.

In order to enable this extension an OAuth 2.0 scope containing
"openid" is needed. Other OAuth 2.0 requests should not be impacted by
this change.

This minimal implementation is enough to enable single sign-on (SSO)
for other sites, e.g. by using something like `mod_auth_openidc` to
only allow access to a CI server if a user has logged into Gitea.

Fixes: #1310

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
2021-01-02 00:33:27 +08:00
..
admin Custom icons for OAuth sources (#14161) 2020-12-28 03:35:55 +01:00
api/v1 Team dashboards (#14159) 2020-12-27 21:58:03 +02:00
dev Display ui time with customize time location (#7792) 2019-08-15 22:46:21 +08:00
events Add EventSource support (#11235) 2020-05-07 22:49:00 +01:00
org migrate from com.* to alternatives (#14103) 2020-12-25 11:59:32 +02:00
private Check for 'main' as potential default branch name (#14193) 2020-12-30 15:46:26 +00:00
repo migrate from com.* to alternatives (#14103) 2020-12-25 11:59:32 +02:00
routes Team dashboards (#14159) 2020-12-27 21:58:03 +02:00
user Minimal OpenID Connect implementation (#14139) 2021-01-02 00:33:27 +08:00
utils Return the full rejection message and errors in flash errors (#13221) 2020-10-20 19:50:10 -04:00
home.go Simplify CheckUnitUser logic (#12854) 2020-09-15 19:49:34 -04:00
init.go Move webhook type from int to string (#13664) 2020-12-08 11:41:14 +01:00
install.go migrate from com.* to alternatives (#14103) 2020-12-25 11:59:32 +02:00
metrics.go Move metrics from macaron to chi (#13601) 2020-11-17 15:50:06 -05:00
swagger_json.go Add gitea-vet (#10948) 2020-04-05 07:20:50 +01:00