package FPauth-strategies

  1. Overview
  2. Docs

TOTP is a time-based One-Time Password strategy. User's identity is verified via a password which is limited for a limited time only.

Requires "totp_code" param, otherwise skipped. Provides these routes in "/totp" scope:

  • GET "/generate_secret" is the first step to enable TOTP. Generates a secret for a user. The user must be authenticated first. The user must have TOTP disabled.
  • POST "/finish_setup" is the second step to enable TOTP. Should recieve "totp_code" as param, verifies it and enables TOTP if it was correct.
val name : string

Name of the strategy.

module type MODEL = sig ... end

MODEL contains requirements for user model in order to use the strategy

module type RESPONSES = sig ... end

RESPONSES contains data representations for certain events

module Make (R : RESPONSES) (M : MODEL) (V : FPauth_core.Auth_sign.VARIABLES with type entity = M.t) : sig ... end

Make creates a strategy for a provided model with provided responses.

Module with responses for TOTP in JSON format

module type HTML_settings = sig ... end

This module contains such settings as app name for titles

This functor creates module with RESPONSES in HTML format

val make_html_responses : ?app_name:string -> unit -> (module RESPONSES)

make_html_responses ~app_name () is a convinience function for creating HTML response module without HTML_settings. Returns first-class module.

OCaml

Innovation. Community. Security.