discourse/spec/support
Osama Sayegh eb5a3cfded
FEATURE: Add 2FA support to the Discourse Connect Provider protocol (#16386)
Discourse has the Discourse Connect Provider protocol that makes it possible to
use a Discourse instance as an identity provider for external sites. As a
natural extension to this protocol, this PR adds a new feature that makes it
possible to use Discourse as a 2FA provider as well as an identity provider.

The rationale for this change is that it's very difficult to implement 2FA
support in a website and if you have multiple websites that need to have 2FA,
it's unrealistic to build and maintain a separate 2FA implementation for each
one. But with this change, you can piggyback on Discourse to take care of all
the 2FA details for you for as many sites as you wish.

To use Discourse as a 2FA provider, you'll need to follow this guide:
https://meta.discourse.org/t/-/32974. It walks you through what you need to
implement on your end/site and how to configure your Discourse instance. Once
you're done, there is only one additional thing you need to do which is to
include `require_2fa=true` in the payload that you send to Discourse.

When Discourse sees `require_2fa=true`, it'll prompt the user to confirm their
2FA using whatever methods they've enabled (TOTP or security keys), and once
they confirm they'll be redirected back to the return URL you've configured and
the payload will contain `confirmed_2fa=true`. If the user has no 2FA methods
enabled however, the payload will not contain `confirmed_2fa`, but it will
contain `no_2fa_methods=true`.

You'll need to be careful to re-run all the security checks and ensure the user
can still access the resource on your site after they return from Discourse.
This is very important because there's nothing that guarantees the user that
will come back from Discourse after they confirm 2FA is the same user that
you've redirected to Discourse.

Internal ticket: t62183.
2022-04-13 15:04:09 +03:00
..
versioning DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
concurrency.rb Revert "FIX: Redis fallback handler refactoring (#8771)" (#8776) 2020-01-24 09:20:17 +11:00
diagnostics_helper.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
discourse_event_helper.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
fake_logger.rb DEV: Fix FakeLogger spec issues (#12397) 2021-03-15 15:36:10 +11:00
fast_image_helpers.rb FIX: remove 'crawl_images' site setting (#14646) 2021-10-19 17:12:29 +05:30
helpers.rb PERF: Fix n+1 for categories + featured topics (#16188) 2022-03-14 22:23:39 +00:00
imap_helper.rb DEV: Move imap_helper to spec/support directory (#14776) 2021-10-29 20:46:25 +02:00
integration_helpers.rb FEATURE: Allow using invites when DiscourseConnect SSO is enabled (#12419) 2021-03-19 10:20:10 +10:00
match_html_matcher.rb FIX: Make Oneboxer#apply insert block Oneboxes correctly (#11449) 2020-12-14 17:49:37 +02:00
onebox_helpers.rb DEV: Absorb onebox gem into core (#12979) 2021-05-26 15:11:35 +05:30
rate_limit_matcher.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
session_controller_helper_routes.rb FEATURE: Centralized 2FA page (#15377) 2022-02-17 12:12:59 +03:00
shared_examples_for_stats_cacheable.rb DEV: Correct typos and spelling mistakes (#12812) 2021-05-21 11:43:47 +10:00
sidekiq_helpers.rb DEV: Change Topic Timer from enqueue_at scheduled jobs to incrementally executed jobs (#11698) 2021-01-19 13:30:58 +10:00
site_settings_helpers.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
test_second_factor_action.rb FEATURE: Add 2FA support to the Discourse Connect Provider protocol (#16386) 2022-04-13 15:04:09 +03:00
time_matcher.rb DEV: adds within_one_minute time matcher (#12109) 2021-02-17 10:52:49 +01:00
uploads_helpers.rb FIX: Match for indeterminate depth in URL during upload tests (#15186) 2021-12-03 16:05:27 -06:00
webauthn_integration_helpers.rb DEV: stop freezing frozen strings 2020-04-30 16:48:53 +10:00