Package com.irurueta.authserver.authorization.api.web.totp
package com.irurueta.authserver.authorization.api.web.totp
Time-based one-time password (TOTP) second factor. Filled by the TOTP issue.
-
ClassDescriptionKeeps, in the session, the recovery codes generated when an authenticator app is enrolled during the sign-in, from the post that confirms it until the page that shows them once (
RecoveryCodesPageController), which takes them out of the session.Renders a text as a QR code, as a PNG image in adata:URI an authenticator app enrolment page can show without another request.Generates a new set of recovery codes for the authenticated account.Serves the page that shows, once, the recovery codes generated when an authenticator app was enrolled during the sign-in, as the contractapis/auth-server/web-pages/auth-server-pages-v1.yamldescribes it through the generatedRecoveryCodesPageApi.Success handler of the second-factor post: when the post confirmed an enrolment and recovery codes are waiting to be shown, the browser goes to the page that shows them once (whose "Continue" button resumes the interrupted request); otherwise the delegate resumes the interrupted request straight away.Processes the post of the second-factor forms (POST /login/second-factor/totp): the TOTP form, the recovery-code form and the enrolment form (fieldenroll) of a user who has no authenticator app yet.Verifies a TOTP code or a recovery code for the signed-in user, or the first code of an authenticator app being enrolled during the sign-in, which confirms it, through theTotpCodeVerifier.Request to verify a second factor: the authentication the user already holds (the primary factor) and the code the user typed, and what kind of code it is.Adds the TOTP second factor to the login/UI chain: the second-factor page and the post of its forms are open to a user who has signed in with a password (and only to such a user), and the filters that verify the code and recognise a trusted device are installed before the authorization check.Hands the session authentication strategy of the chain to the TOTP filter.What the code posted to the TOTP filter is.Sends a posted code to the use case of its kind (TotpCodeKind): a TOTP code, a recovery code, or the first code of an authenticator app enrolled during the sign-in.Wires the TOTP second factor into the login/UI chain.Enrols, confirms and disables the authenticator app of the authenticated account.Maps the results of the authenticator app and recovery code use cases onto the DTOs generated from the contract.Registers the time-based one-time password (and the recovery codes that stand in for it) as an authentication factor: a second one, which only counts once a primary factor has been presented.Contributes the TOTP forms to the second-factor page, as every second factor does through theSecondFactorFragmentextension point.