gitea/services/auth/source/oauth2
wxiaoguang 0148d03f21
Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187)
Fix #880

Design:

1. A global setting `security.TWO_FACTOR_AUTH`.
* To support org-level config, we need to introduce a better "owner
setting" system first (in the future)
2. A user without 2FA can login and may explore, but can NOT read or
write to any repositories via API/web.
3. Keep things as simple as possible.
* This option only aggressively suggest users to enable their 2FA at the
moment, it does NOT guarantee that users must have 2FA before all other
operations, it should be good enough for real world use cases.
* Some details and tests could be improved in the future since this
change only adds a check and seems won't affect too much.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-04-28 15:31:59 -07:00
..
assert_interface_test.go Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187) 2025-04-28 15:31:59 -07:00
init.go Make oauth2 code clear. Move oauth2 provider code to their own packages/files (#32148) 2024-10-02 08:03:19 +08:00
main_test.go allow synchronizing user status from OAuth2 login providers (#31572) 2024-07-16 20:33:16 +02:00
providers_base.go Migrate margin and padding helpers to tailwind (#30043) 2024-03-24 17:42:49 +01:00
providers_custom.go Modify OAuth login ui and fix display name, iconurl related logic (#25030) 2023-06-08 16:35:29 +00:00
providers_openid.go Migrate margin and padding helpers to tailwind (#30043) 2024-03-24 17:42:49 +01:00
providers_simple.go Modify OAuth login ui and fix display name, iconurl related logic (#25030) 2023-06-08 16:35:29 +00:00
providers_test.go allow synchronizing user status from OAuth2 login providers (#31572) 2024-07-16 20:33:16 +02:00
providers.go Fix tautological conditions (#30735) 2024-04-30 14:34:40 +02:00
source_authenticate.go Reduce usage of db.DefaultContext (#27073) 2023-09-14 17:09:32 +00:00
source_callout.go Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187) 2025-04-28 15:31:59 -07:00
source_name.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
source_register.go Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187) 2025-04-28 15:31:59 -07:00
source_sync_test.go Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187) 2025-04-28 15:31:59 -07:00
source_sync.go Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187) 2025-04-28 15:31:59 -07:00
source.go Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187) 2025-04-28 15:31:59 -07:00
store.go fix: Fix to delete cookie when AppSubURL is non-empty (#30375) 2024-04-14 12:46:56 +08:00
urlmapping.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00