Class EnrollTotpUseCase
java.lang.Object
com.irurueta.authserver.authorization.application.totp.EnrollTotpUseCase
Use case that starts the enrolment of an authenticator app: it generates a secret, stores it encrypted and
unconfirmed (replacing any earlier unconfirmed one) and returns the
otpauth:// URI to show as a QR code.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClockSource of the current time.private final MfaPropertiesMulti-factor settings: the issuer shown by the authenticator app.private final SecretGeneratorGenerator of the shared secrets.private final TotpCredentialRepositoryPort that stores the TOTP credentials.private final TotpSecretCipherPort that encrypts the secrets at rest. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
totpCredentialRepository
Port that stores the TOTP credentials. -
totpSecretCipher
Port that encrypts the secrets at rest. -
secretGenerator
Generator of the shared secrets. -
clock
Source of the current time. -
mfaProperties
Multi-factor settings: the issuer shown by the authenticator app.
-
-
Constructor Details
-
EnrollTotpUseCase
public EnrollTotpUseCase()
-
-
Method Details
-
execute
Starts the enrolment.- Parameters:
userId- identifier of the user.username- name of the user, shown by the authenticator app.- Returns:
- the
otpauth://URI. - Throws:
TotpAlreadyEnabledException- if the user already confirmed an authenticator app.
-