Class TrustedDeviceController
java.lang.Object
com.irurueta.authserver.authorization.api.web.mfa.TrustedDeviceController
- All Implemented Interfaces:
TrustedDevicesApi
Lists and revokes the trusted devices of the authenticated account. The paths, status codes and bodies are those
of the contract
apis/auth-server/rest-server/auth-server-api-v1.yaml, through the generated
TrustedDevicesApi; failures are answered by MfaExceptionHandler. Revoking a device needs a recent
multi-factor sign-in (StepUpGuard).-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CurrentAccountResolverResolves the account of the request.private final ListTrustedDevicesUseCaseLists the devices of an account.private final RevokeTrustedDeviceUseCaseRevokes a device.private final StepUpGuardRequires a recent multi-factor sign-in before a device is revoked.private final TrustedDeviceDtoMapperMaps the devices onto the contract's DTOs.Fields inherited from interface com.irurueta.authserver.authorization.api.web.v1.generated.api.TrustedDevicesApi
PATH_LIST_TRUSTED_DEVICES, PATH_REVOKE_TRUSTED_DEVICE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<List<TrustedDeviceResponse>> Lists the devices that are still trusted.org.springframework.http.ResponseEntity<Void> Revokes a device of the authenticated account.
-
Field Details
-
currentAccountResolver
Resolves the account of the request. -
listTrustedDevicesUseCase
Lists the devices of an account. -
revokeTrustedDeviceUseCase
Revokes a device. -
stepUpGuard
Requires a recent multi-factor sign-in before a device is revoked. -
trustedDeviceDtoMapper
Maps the devices onto the contract's DTOs.
-
-
Constructor Details
-
TrustedDeviceController
public TrustedDeviceController()
-
-
Method Details
-
listTrustedDevices
Lists the devices that are still trusted.- Specified by:
listTrustedDevicesin interfaceTrustedDevicesApi- Returns:
200 OKwith the devices of the authenticated account.
-
revokeTrustedDevice
Revokes a device of the authenticated account.- Specified by:
revokeTrustedDevicein interfaceTrustedDevicesApi- Parameters:
id- identifier of the device.- Returns:
204 No Content.- Throws:
TrustedDeviceNotFoundException- if the account has no such device.InsufficientUserAuthenticationException- if the token does not show a recent multi-factor sign-in.
-