Record Class SignedInDevice
java.lang.Object
java.lang.Record
com.iizix.user.SignedInDevice
- Record Components:
deviceID- The device: the device UUID of an iiziRun device, or the identifier the server issued to a Browser when it first remembered the user there.appID- The application the device is remembered for.deviceName- What the device said it is when it was last used, e.g. "Browser, Windows"; for display only, never trusted.created- When the user was first remembered on the device, in epoch milliseconds.lastUsed- When the device last signed in or was last remembered, in epoch milliseconds.expires- When the device is forgotten unless it is used before, in epoch milliseconds.staySignedIn-truewhen the device may sign the user in without the password,falsewhen it is remembered for something else only (trusted for MFA).mfaTrustedUntil- Until when the device is trusted for MFA, in epoch milliseconds; zero when it is not.current-truefor the device of the session that asked.
public record SignedInDevice(String deviceID, String appID, String deviceName, long created, long lastUsed, long expires, boolean staySignedIn, long mfaTrustedUntil, boolean current) extends Record
A device a user is remembered on: one row of the user's device tokens, as the SignIn module lists them for the user to look through and to revoke (CC-LOGIN-L5-DEVICE-TOKEN, SignIn L-5; F-18 of the SignIn survey). It carries nothing secret: the device's token is known to the device alone, and the server keeps only its hash.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorsConstructorDescriptionSignedInDevice(String deviceID, String appID, String deviceName, long created, long lastUsed, long expires, boolean staySignedIn, long mfaTrustedUntil, boolean current) Creates an instance of aSignedInDevicerecord class.Method Summary
Modifier and TypeMethodDescriptionappID()Returns the value of theappIDrecord component.longcreated()Returns the value of thecreatedrecord component.booleancurrent()Returns the value of thecurrentrecord component.deviceID()Returns the value of thedeviceIDrecord component.Returns the value of thedeviceNamerecord component.final booleanIndicates whether some other object is "equal to" this one.longexpires()Returns the value of theexpiresrecord component.final inthashCode()Returns a hash code value for this object.booleanisMfaTrusted(long now) Tells whether the device is trusted for MFA at a time.longlastUsed()Returns the value of thelastUsedrecord component.longReturns the value of themfaTrustedUntilrecord component.booleanReturns the value of thestaySignedInrecord component.final StringtoString()Returns a string representation of this record class.
Constructor Details
SignedInDevice
public SignedInDevice(String deviceID, String appID, String deviceName, long created, long lastUsed, long expires, boolean staySignedIn, long mfaTrustedUntil, boolean current) Creates an instance of aSignedInDevicerecord class.- Parameters:
deviceID- the value for thedeviceIDrecord componentappID- the value for theappIDrecord componentdeviceName- the value for thedeviceNamerecord componentcreated- the value for thecreatedrecord componentlastUsed- the value for thelastUsedrecord componentexpires- the value for theexpiresrecord componentstaySignedIn- the value for thestaySignedInrecord componentmfaTrustedUntil- the value for themfaTrustedUntilrecord componentcurrent- the value for thecurrentrecord component
Method Details
isMfaTrusted
public boolean isMfaTrusted(long now) Tells whether the device is trusted for MFA at a time.- Parameters:
now- The time in epoch milliseconds.- Returns:
truewhen it is.
toString
hashCode
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes.deviceID
appID
deviceName
Returns the value of thedeviceNamerecord component.- Returns:
- the value of the
deviceNamerecord component
created
lastUsed
expires
staySignedIn
public boolean staySignedIn()Returns the value of thestaySignedInrecord component.- Returns:
- the value of the
staySignedInrecord component
mfaTrustedUntil
public long mfaTrustedUntil()Returns the value of themfaTrustedUntilrecord component.- Returns:
- the value of the
mfaTrustedUntilrecord component
current