]> source.dussan.org Git - gitea.git/commit
Support SAML authentication (#25165)
authortechknowlogick <techknowlogick@gitea.com>
Fri, 23 Feb 2024 00:08:17 +0000 (19:08 -0500)
committerGitHub <noreply@github.com>
Fri, 23 Feb 2024 00:08:17 +0000 (00:08 +0000)
commit5bb8d1924d77c675467694de26697b876d709a17
tree5082621a5a26d56b5eccd2a70bbb35a76a2c6ae5
parentc4b0cb4d0d527793296cf801e611f77666f86551
Support SAML authentication (#25165)

Closes https://github.com/go-gitea/gitea/issues/5512

This PR adds basic SAML support
- Adds SAML 2.0 as an auth source
- Adds SAML configuration documentation
- Adds integration test:
- Use bare-bones SAML IdP to test protocol flow and test account is
linked successfully (only runs on Postgres by default)
- Adds documentation for configuring and running SAML integration test
locally

Future PRs:
- Support group mapping
- Support auto-registration (account linking)

Co-Authored-By: @jackHay22
---------

Co-authored-by: jackHay22 <jack@allspice.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: morphelinho <morphelinho@users.noreply.github.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
37 files changed:
.github/workflows/pull-db-tests.yml
assets/go-licenses.json
docs/content/usage/authentication.en-us.md
go.mod
go.sum
models/auth/oauth2.go
models/auth/source.go
options/locale/locale_en-US.ini
routers/init.go
routers/web/admin/auths.go
routers/web/auth/auth.go
routers/web/auth/linkaccount.go
routers/web/auth/oauth.go
routers/web/auth/openid.go
routers/web/auth/saml.go [new file with mode: 0644]
routers/web/web.go
services/auth/source/saml/assert_interface_test.go [new file with mode: 0644]
services/auth/source/saml/init.go [new file with mode: 0644]
services/auth/source/saml/name_id_format.go [new file with mode: 0644]
services/auth/source/saml/providers.go [new file with mode: 0644]
services/auth/source/saml/source.go [new file with mode: 0644]
services/auth/source/saml/source_authenticate.go [new file with mode: 0644]
services/auth/source/saml/source_callout.go [new file with mode: 0644]
services/auth/source/saml/source_metadata.go [new file with mode: 0644]
services/auth/source/saml/source_register.go [new file with mode: 0644]
services/externalaccount/link.go
services/externalaccount/user.go
services/forms/auth_form.go
templates/admin/auth/edit.tmpl
templates/admin/auth/new.tmpl
templates/admin/auth/source/saml.tmpl [new file with mode: 0644]
templates/user/auth/signin_inner.tmpl
tests/integration/README.md
tests/integration/saml_test.go [new file with mode: 0644]
web_src/js/features/admin/common.js
web_src/js/features/user-auth.js
web_src/js/index.js