Package org.cyclos.impl.access
Interface TrustedDeviceServiceLocal
-
- All Superinterfaces:
Service,TrustedDeviceService
public interface TrustedDeviceServiceLocal extends TrustedDeviceService
Local interface for trusted devices.
-
-
Field Summary
Fields Modifier and Type Field Description static intSECRET_KEY_LENGTHLength in chars of the generated device key.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcheckForLogin(String remoteAddress, String deviceConfirmationId, String hmac)Checks the if the current trusted device can be used for login validating the given PENDING confirmation.
This method only work for sessions with a trusted device, i.e if the current session data is not associated to a trusted device it throws anIllegalActionExceptionbooleanexists(long id)Returns true if exist an active trusted device with the given id.DeviceActivationModegetDeviceActivationMode()Calculates the device activation mode for the logged user according the the existing devices the user has, its available mediums and whether there is a channel requiring a trusted device for login.booleanhasActiveDevices(BasicUser user)Returns true if the given user has at least one active trusted device.TrustedDeviceloadForOperate(long id)Loads an active trusted device for the logged user;longpurgePendingActivations(Date before)Delete all trusted devices created before the date passed as parameter and which activation code is not null (they were not activated).-
Methods inherited from interface org.cyclos.services.access.TrustedDeviceService
activate, activateIfPossible, getActivationData, getConfirmationPasswordInputForRemove, getData, list, remove, requestActivationCode, save
-
-
-
-
Field Detail
-
SECRET_KEY_LENGTH
static final int SECRET_KEY_LENGTH
Length in chars of the generated device key.- See Also:
- Constant Field Values
-
-
Method Detail
-
checkForLogin
void checkForLogin(String remoteAddress, String deviceConfirmationId, String hmac)
Checks the if the current trusted device can be used for login validating the given PENDING confirmation.
This method only work for sessions with a trusted device, i.e if the current session data is not associated to a trusted device it throws anIllegalActionException- Parameters:
remoteAddress- the client address to check if it's already blocked or notdeviceConfirmationId- the pendingDeviceConfirmationType.LOGINconfirmationhmac- the HMAC generated in the client using its private key
-
exists
boolean exists(long id)
Returns true if exist an active trusted device with the given id.
-
getDeviceActivationMode
DeviceActivationMode getDeviceActivationMode()
Calculates the device activation mode for the logged user according the the existing devices the user has, its available mediums and whether there is a channel requiring a trusted device for login.
-
hasActiveDevices
boolean hasActiveDevices(BasicUser user)
Returns true if the given user has at least one active trusted device.
-
loadForOperate
TrustedDevice loadForOperate(long id) throws EntityNotFoundException
Loads an active trusted device for the logged user;- Throws:
EntityNotFoundException- if the id doesn't exists, the device is pending by activation or doesn't belong to the logged user.
-
purgePendingActivations
long purgePendingActivations(Date before)
Delete all trusted devices created before the date passed as parameter and which activation code is not null (they were not activated). Returns the count of deleted trusted devices.
-
-