Package org.cyclos.services.access
Interface TrustedDeviceService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ActivateTrustedDeviceDTOactivate(@NotNull TrustedDeviceActivationParams params)Activates a trusted device by code or if a trusted device is required for activation then use theTrustedDeviceActivationParams.DEVICE_IDandTrustedDeviceActivationParams.DEVICE_CONFIRMATION_IDto ensure the corresponding device confirmation was already approved (using another trusted device).TrustedDeviceActivationDatagetActivationData()Returns data required to activate a device for the logged user.PasswordInputDTOgetConfirmationPasswordInputForRemove(@NotNull Long id)Returns thePasswordInputDTOfor the confirmation password that would be required if removing the trusted device with the given idTrustedDeviceDatagetData(long id)Returns data about a trusted device.List<TrustedDeviceVO>list(UserLocatorVO locator)Returns the list of trusted devices for the given user (null resolves to the logged user).
Manager users must have thePermission.USER_TRUSTED_DEVICES_VIEWpermission.voidremove(Long id, String confirmationPassword)Removes a trusted device by id for the logged user.RequestActivationResultrequestActivationCode(@NotNull RequestDeviceActivationParams params)Requests for an activation code.voidsave(@NotNull TrustedDeviceDTO dto)Updates a given trusted device for the logged user.
-
-
-
Method Detail
-
activate
ActivateTrustedDeviceDTO activate(@NotNull @NotNull TrustedDeviceActivationParams params) throws FrameworkException
Activates a trusted device by code or if a trusted device is required for activation then use theTrustedDeviceActivationParams.DEVICE_IDandTrustedDeviceActivationParams.DEVICE_CONFIRMATION_IDto ensure the corresponding device confirmation was already approved (using another trusted device).- Throws:
FrameworkException
-
getActivationData
TrustedDeviceActivationData getActivationData() throws FrameworkException
Returns data required to activate a device for the logged user.- Throws:
FrameworkException
-
getConfirmationPasswordInputForRemove
PasswordInputDTO getConfirmationPasswordInputForRemove(@NotNull @NotNull Long id) throws FrameworkException
Returns thePasswordInputDTOfor the confirmation password that would be required if removing the trusted device with the given id- Throws:
FrameworkException
-
getData
TrustedDeviceData getData(long id) throws FrameworkException
Returns data about a trusted device.- Throws:
FrameworkException
-
list
List<TrustedDeviceVO> list(UserLocatorVO locator) throws FrameworkException
Returns the list of trusted devices for the given user (null resolves to the logged user).
Manager users must have thePermission.USER_TRUSTED_DEVICES_VIEWpermission.- Throws:
FrameworkException
-
remove
void remove(Long id, String confirmationPassword) throws FrameworkException
Removes a trusted device by id for the logged user.- Throws:
FrameworkException
-
requestActivationCode
RequestActivationResult requestActivationCode(@NotNull @NotNull RequestDeviceActivationParams params) throws FrameworkException
Requests for an activation code. This method can be used to request a code for the first time or as a new request for a given device. In case aRequestDeviceActivationParams.DEVICE_IDis given then the same existing code for that device will be send again and the the name won't be changed (it's ignored if given). Otherwise, a new pending trusted device will be created for the logged user and the code will be sent (in that case the name is required). (phone / e-mail). IfRequestDeviceActivationParams.MEDIUMisSendMedium.SMSthen the message will be send to the (required)RequestDeviceActivationParams.MOBILE_PHONE.- Returns:
- A VO with the following:
- The final name assigned to the device. It could be different to the input name if it's already in use
- The device id (required to re-send the code)
- The e-mail or the normalized mobile phone number that received the code
- The creation date
- Throws:
FrameworkException
-
save
void save(@NotNull @NotNull TrustedDeviceDTO dto) throws FrameworkExceptionUpdates a given trusted device for the logged user. It will be used from the mobile in the settings page.- Throws:
FrameworkException
-
-