Acquire.Identity._authorisation module¶
Bases:
objectThis class holds the information needed to show that a user has authorised an action. This contains a signed token that records the time that the authorisation that was signed, together with an extra key (or secret) that can be used by the user and provider to verify that the authorisation is for the correct resource
Return an authorisation created from the json-decoded dictionary
Return whether or not this authorisation comes from the user with passed user_uid registered on the passed service_uid
Return the UID of the identity service that authenticated the user
Return the URL of the identity service that authenticated the user
Return whether or not this authorisation is null
Return whether or not this authorisation is stale. ‘stale_time’ is the number of seconds after which the authorisation is considered stale (and thus no longer valid)
Return whether or not this authorisation has been verified. Note that this will cache any verification for ‘refresh_time’ (in seconds)
‘stale_time’ gives the time (in seconds) beyond which the authorisation will be considered stale (and thus not valid). By default this is 7200 seconds (2 hours), meaning that the authorisation must be used within 2 hours to be valid.
Return the last time this authorisation was verified. Note that you should re-verify authorisations periodically, to ensure that they identity service is still happy that the login session was not suspicious
Return the login session that authenticated the user
Return the actual signature
Return the time when the authentication was signed
Return this object serialised to a json-encoded dictionary
Return the global UID for this user
Return the UID of the user who created this authorisation
Verify that this is a valid authorisation provided by the user for the passed ‘resource’. This will cache the verification for ‘refresh_time’ (in seconds), but re-verification can be forced if ‘force’ is True.
‘stale_time’ gives the time (in seconds) beyond which the authorisation will be considered stale (and thus not valid). By default this is 7200 seconds (2 hours), meaning that the authorisation must be used within 2 hours to be valid.
If ‘testing_key’ is passed, then this object is being tested as part of the unit tests