Acquire.Identity._loginsession module¶
-
class
LoginSession(username=None, public_key=None, public_cert=None, ipaddr=None, hostname=None, login_message=None, scope=None, permissions=None)[source]¶ Bases:
objectThis class holds all details of a single login session
-
device_uid()[source]¶ If known, return the UID of the device from which the user approved this session
-
encoded_username()[source]¶ Return a safely-encoded version of the username. This is used to create safe keys in the object store
-
static
load(status=None, short_uid=None, uid=None, scope=None, permissions=None)[source]¶ Load and return a LoginSession specified from either a short_uid or a long uid. Note that if more than one session matches the short_uid then you will get a list of LoginSessions returned
-
login(user_uid=None, device_uid=None)[source]¶ Convenience function to set the session into the logged in state
-
login_time()[source]¶ Return the date and time when the user logged in. This returns None if the user has not yet logged in
-
login_url()[source]¶ Return the login URL to login to this session. This is the URL of this identity service plus the short UID of the session
-
logout(authorisation=None, signature=None)[source]¶ Convenience function to set the session into the logged out state
-
logout_time()[source]¶ Return the date and time when the user logged out. This returns None if the user has not yet logged out
-
request_source()[source]¶ Return the IP address of the source of this request. This could be used to rate limit someone who is maliciously requesting logins…
-
set_approved(user_uid=None, device_uid=None)[source]¶ Register that this request has been approved, optionally providing data about the user who approved the session and the device from which the session was approved
-
set_logged_out(authorisation=None, signature=None)[source]¶ Register that this request has been closed as the user has logged out. If an authorisation is passed then verify that this is correct
-
set_suspicious()[source]¶ Put this login session into a suspicious state. This will be because weird activity has been detected which indicates that the session may be have been cracked. A login session in a suspicious state should not be granted any permissions.
-
short_uid()[source]¶ Return a short UUID that will be used to provide a more human-readable session ID
-