Package org.cyclos.impl.access
Interface TrustedDeviceServiceLocal
-
- All Superinterfaces:
Service,TrustedDeviceService
- All Known Implementing Classes:
TrustedDeviceServiceImpl
public interface TrustedDeviceServiceLocal extends TrustedDeviceService
Local interface for trusted devices.
-
-
Field Summary
Fields Modifier and Type Field Description static intACTIVATION_CODE_LENGTHLength in chars of the generated device activation code.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.booleanhasActiveDevices(BasicUser user)Returns true if the given user has at least one active trusted device.booleanhasAvailableSendMediums()Returns true if the logged user has at least one medium to send to the activation code.booleanisRequireTrustedDeviceForLogin()Returns true if at least one channel (not only the current channel) requires trusted devices for loginTrustedDeviceloadForOperate(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, 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
-
ACTIVATION_CODE_LENGTH
static final int ACTIVATION_CODE_LENGTH
Length in chars of the generated device activation code.- 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.
-
hasActiveDevices
boolean hasActiveDevices(BasicUser user)
Returns true if the given user has at least one active trusted device.
-
hasAvailableSendMediums
boolean hasAvailableSendMediums()
Returns true if the logged user has at least one medium to send to the activation code.
-
isRequireTrustedDeviceForLogin
boolean isRequireTrustedDeviceForLogin()
Returns true if at least one channel (not only the current channel) requires trusted devices for login
-
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.
-
-