(self)
return access_token
Generate an access token after password authorization.
Generate an access token after password authorization.
Generate an access token after password authorization .
def _get_password_token(self):
        """Generate an access token after password authorization."""
        access_token = AccessToken.objects.create(
            user=self.user,
            client=self.client,
            refreshable=self.refreshable)
        if self.authentication_method == MAC:
            access_token.mac_key = KeyGenerator(MAC_KEY_LENGTH)()
        access_ranges = AccessRange.objects.filter(key__in=self.scope) if self.scope else []
        access_token.scope = access_ranges
        access_token.save()
        return access_token
def _get_password_token ( self ) : access_token = AccessToken . objects . create ( user = self . user , client = self . client , refreshable = self . refreshable ) if self . authentication_method == MAC : access_token . mac_key = KeyGenerator ( MAC_KEY_LENGTH ) ( ) access_ranges = AccessRange . objects . filter ( key__in = self . scope ) if self . scope else [ ] access_token . scope = access_ranges access_token . save ( ) return access_token