Learn how to use Authsignal with Ruby on Rails to implement Multi-factor Authentication and Passkeys
config/initializers/authsignal.rb
:
app/javascript/application.js
. Doing this initializes the Authsignal cookie.
track_action
input redirect_to_settings: true
. Read more on enrolling authenticators
authsignal-ruby
SDK. If Authsignal returns a challenge and the user is enrolled with authentication factors, we will redirect the user to a challenge flow and on completion of the challenge, complete the login process.
Insert the following after_authentication
hook into config/initializers/warden.rb
. This block fires after a successful login and makes the track
call.
app/controllers/users/sessions_controller.rb
:
complete_mfa
action into your routes.rb
file:
create
which calls track
and complete
which is called after the user finishes a challenge flow. These are all called via a JSON request from the stimulus client-side.