Class RecoveryCodeController
java.lang.Object
com.irurueta.authserver.authorization.api.web.totp.RecoveryCodeController
- All Implemented Interfaces:
RecoveryCodesApi
Generates a new set of recovery codes for the authenticated account. The path, status codes and body are those of
the contract
apis/auth-server/rest-server/auth-server-api-v1.yaml, through the generated
RecoveryCodesApi. The answer is never cached, since it carries the codes. Replacing the codes needs a recent
multi-factor sign-in (StepUpGuard).-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CurrentAccountResolverResolves the account of the request.private final GenerateRecoveryCodesUseCaseGenerates the codes.private final StepUpGuardRequires a recent multi-factor sign-in before the codes are replaced.private final TotpDtoMapperMaps the codes onto the contract's DTO.Fields inherited from interface com.irurueta.authserver.authorization.api.web.v1.generated.api.RecoveryCodesApi
PATH_GENERATE_RECOVERY_CODES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<RecoveryCodesResponse> Replaces the recovery codes of the authenticated account.
-
Field Details
-
currentAccountResolver
Resolves the account of the request. -
stepUpGuard
Requires a recent multi-factor sign-in before the codes are replaced. -
generateRecoveryCodesUseCase
Generates the codes. -
totpDtoMapper
Maps the codes onto the contract's DTO.
-
-
Constructor Details
-
RecoveryCodeController
public RecoveryCodeController()
-
-
Method Details
-
generateRecoveryCodes
Replaces the recovery codes of the authenticated account.- Specified by:
generateRecoveryCodesin interfaceRecoveryCodesApi- Returns:
200 OKwith the new codes, shown only once.- Throws:
InsufficientUserAuthenticationException- if the token does not show a recent multi-factor sign-in.
-