Class CreateTrustedDeviceUseCase
java.lang.Object
com.irurueta.authserver.authorization.application.mfa.CreateTrustedDeviceUseCase
Use case that trusts the browser of a user for some days so it skips the second factor. The raw token is returned
once, signed, as the value of the cookie; only its SHA-256 hash is stored.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClockSource of the current time.private final MfaPropertiesMulti-factor settings: how long a device stays trusted.private final RecordSecurityEventUseCaseUse case that records the audit events.private final TrustedDeviceRepositoryPort that stores the trusted devices.private final TrustedDeviceTokensCreator and hasher of the tokens.private final TrustedDeviceTokenSignerPort that signs the cookie value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTrusts a device.
-
Field Details
-
trustedDeviceRepository
Port that stores the trusted devices. -
trustedDeviceTokens
Creator and hasher of the tokens. -
trustedDeviceTokenSigner
Port that signs the cookie value. -
recordSecurityEventUseCase
Use case that records the audit events. -
clock
Source of the current time. -
mfaProperties
Multi-factor settings: how long a device stays trusted.
-
-
Constructor Details
-
CreateTrustedDeviceUseCase
public CreateTrustedDeviceUseCase()
-
-
Method Details
-
execute
Trusts a device.- Parameters:
userId- identifier of the user.username- name of the user, for the audit log.userAgentSummary- short description of the browser, ornull.- Returns:
- the device and the signed cookie value.
-