1
1
mirror of https://github.com/go-gitea/gitea synced 2024-10-31 23:34:25 +00:00
gitea/modules/auth
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
..
ldap [Vendor] Update go-ldap to v3.2.4 (#13163) 2020-10-15 15:27:33 -04:00
oauth2 Fix creating OAuth2 auth source from CLI (#14116) 2020-12-24 19:47:17 +00:00
openid Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
pam Remove PAM from auth dropdown when unavailable (#13276) 2020-10-23 11:10:29 +01:00
sso API: Make BasicAuth Prefix case insensitive (#14106) 2020-12-23 20:52:46 +01:00
admin.go Multiple small admin dashboard fixes (#12153) 2020-07-05 22:38:03 +03:00
auth_form.go Custom icons for OAuth sources (#14161) 2020-12-28 03:35:55 +01:00
auth.go Add single sign-on support via SSPI on Windows (#8463) 2019-11-23 01:33:31 +02:00
org.go Team permission to create repository in organization (#8312) 2019-11-20 19:27:49 +08:00
repo_branch_form.go Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
repo_form_test.go Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
repo_form.go Add block on official review requests branch protection (#13705) 2020-11-28 21:30:46 +02:00
user_form_auth_openid.go hCaptcha Support (#12594) 2020-10-02 23:37:53 -04:00
user_form_test.go Block registration based on email domain (#5157) 2018-11-14 20:00:04 -05:00
user_form.go Minimal OpenID Connect implementation (#14139) 2021-01-02 00:33:27 +08:00