diff --git a/rest_framework/authentication.py b/rest_framework/authentication.py index cb9608a3c..d7b4d274b 100644 --- a/rest_framework/authentication.py +++ b/rest_framework/authentication.py @@ -197,6 +197,8 @@ class TokenAuthentication(BaseAuthentication): if not token.user.is_active: raise exceptions.AuthenticationFailed(_('User inactive or deleted.')) + token.user.backend = "{0}.{1}".format(self.__class__.__module__, self.__class__.__name__) + return (token.user, token) def authenticate_header(self, request):