Models¶
Auth Token¶
-
class
auth_token.models.Token¶ Model for storing authorization tokens.
-
key¶ CharField, contains authorization token value.
-
user¶ ForeignKey, foreign key to the logged user.
-
created_at¶ DateTimeField, contains date and time of token creation.
-
last_access¶ DateTimeField, contains date and time of lost token access.
-
is_active¶ BooleanFieldcontains if token is active.
-
user_agent¶ CharField, stored HTTP header User-Agent, that was get during token creation.
-
expiration¶ BooleanField, contains information if user set preserved token.
-
ip¶ IP address of the logged user.
-
auth_slug¶ SlugField, slug that you can use for your own purposes.
-
backend¶ Field contains name of the django authorization backend
-
-
class
auth_token.models.TokenRelatedObject¶ Model storing related objects with authorization token
-
token¶ Relation to the authorization token.
-
content_type¶ Content type of the related object.
-
object_id¶ Identifier of the related object.
-
content_object¶ Related object (
GenericForeignKey)
-
-
class
auth_token.models.UserTokenTakeover¶ Model contains information about token takeover.
-
token¶ Relation to the authorization token.
-
user¶ Took over user.
-
is_active¶ BooleanFieldcontains if token takeover is active.
-
-
class
auth_token.models.AnonymousToken¶ AnonymousTokenhas save purpose as DjangoAnonymousUser. If you are using auth_token middleware, the request contains token (request.token). If token is not found theAnonymousTokenis set to the request.
Device Authentication¶
-
class
auth_token.models.DeviceKey¶ Model storing keys of registered mobile devices.
-
uuid¶ CharField, contains UUID of registered device (it’s not valid UUID in terms of length, any length up to 32 characters is accepted as valid)
-
last_login¶ DateTimeField, holds the time and date of the last login using this key
-
user¶ ForeignKey, user object implementingdjango.contrib.auth.base_user.AbstractBaseUser
-
login_token¶ CharField, hashed generated token used as a password
-
is_active¶ BooleanField, keys having this flag set toFalsewill be ignored during user login
-
user_agent¶ CharField, additional information of the device
-
-
class
auth_token.models.DeviceKeyQuerySet¶ This class is the objects manager of
auth_token.models.DeviceKeymodel-
get_or_create_token(self, uuid, user, user_agent='')¶ uuid-uuid.UUIDobject from standard Python libraryuser- user object implementingdjango.contrib.auth.base_user.AbstractBaseUserclassuser_agent- str object with additional information about the device, could be justHTTP_USER_AGENTentry of META field from therequest.
-