Class FindTrustedDeviceUseCase
java.lang.Object
com.irurueta.authserver.authorization.application.mfa.FindTrustedDeviceUseCase
Use case that finds the usable (not revoked, not expired) trusted device of a user from the value of the cookie.
The signature of the value is checked first, in constant time: a forged or unsigned value is rejected before the
account or the device is looked up.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClockSource of the current time.private final TrustedDeviceRepositoryPort that stores the trusted devices.private final TrustedDeviceTokensCreator and hasher of the tokens.private final TrustedDeviceTokenSignerPort that checks the signature of the cookie value.private final UserAccountRepositoryPort that provides the user accounts. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFinds the device.
-
Field Details
-
trustedDeviceTokenSigner
Port that checks the signature of the cookie value. -
userAccountRepository
Port that provides the user accounts. -
trustedDeviceRepository
Port that stores the trusted devices. -
trustedDeviceTokens
Creator and hasher of the tokens. -
clock
Source of the current time.
-
-
Constructor Details
-
FindTrustedDeviceUseCase
public FindTrustedDeviceUseCase()
-
-
Method Details
-
execute
Finds the device.- Parameters:
username- name the user signed in with.cookieValue- the signed value presented by the browser.- Returns:
- the device, or empty if the signature is wrong, the account does not exist, or the token is unknown, expired, revoked or belongs to another user.
-