Class RemovePhoneUseCase
java.lang.Object
com.irurueta.authserver.authorization.application.sms.RemovePhoneUseCase
Removes the phone of a user, verified and pending. Removing a verified phone removes a second factor, so it is
audited, and when that leaves the user without any confirmed second factor every trusted device of the user is
revoked too, as deleting the last passkey does: a remembered browser stands in for a second factor the user no
longer has.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final StringDetail of the audit event.private final HasConfirmedSecondFactorUseCaseUse case telling whether the user still has a confirmed second factor.private final PhoneVerificationRepositoryPort that stores the pending verifications.private final RecordSecurityEventUseCaseUse case that records the audit events.private final TrustedDeviceRepositoryPort that stores the trusted devices.private final UserPhoneRepositoryPort that stores the verified phones. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
AUDIT_DETAIL
Detail of the audit event.- See Also:
-
userPhoneRepository
Port that stores the verified phones. -
phoneVerificationRepository
Port that stores the pending verifications. -
hasConfirmedSecondFactorUseCase
Use case telling whether the user still has a confirmed second factor. -
trustedDeviceRepository
Port that stores the trusted devices. -
recordSecurityEventUseCase
Use case that records the audit events.
-
-
Constructor Details
-
RemovePhoneUseCase
public RemovePhoneUseCase()
-
-
Method Details
-
execute
Removes the phone and any pending verification of a user.- Parameters:
userId- identifier of the user.username- name of the user, for the audit log.
-