              return (parsed, None)
  
      def _authenticate(self):
          """
          Attempt to authenticate the request using each authentication instance in turn.
          Returns a two-tuple of (user, authtoken).
          """
          for authenticator in self.authenticators:
              user_auth_tuple = authenticator.authenticate(self)
              if not user_auth_tuple is None:
                  return user_auth_tuple
 
</s> remove                 return user_auth_tuple
 </s> add                 user, auth = user_auth_tuple
                return (authenticator, user, auth) </s> remove         if 'HTTP_AUTHORIZATION' in request.META:
            auth = request.META['HTTP_AUTHORIZATION'].split()
            if len(auth) == 2 and auth[0].lower() == "basic":
                try:
                    auth_parts = base64.b64decode(auth[1]).partition(':')
                except TypeError:
                    return None

                try:
                    userid = smart_unicode(auth_parts[0])
                    password = smart_unicode(auth_parts[2])
                except DjangoUnicodeDecodeError:
                    return None

                return self.authenticate_credentials(userid, password)
 </s> add         auth = request.META.get('HTTP_AUTHORIZATION', '').split()

        if not auth or auth[0].lower() != "basic":
            return None

        if len(auth) != 2:
            raise exceptions.AuthenticationFailed('Invalid basic header')

        try:
            auth_parts = base64.b64decode(auth[1]).partition(':')
        except TypeError:
            raise exceptions.AuthenticationFailed('Invalid basic header')

        try:
            userid = smart_unicode(auth_parts[0])
            password = smart_unicode(auth_parts[2])
        except DjangoUnicodeDecodeError:
            raise exceptions.AuthenticationFailed('Invalid basic header')

        return self.authenticate_credentials(userid, password) </s> remove             self._user, self._auth = self._authenticate()
 </s> add             self._authenticator, self._user, self._auth = self._authenticate()
        Attempt to authenticate the request using each authentication instance
        in turn.
        Returns a three-tuple of (authenticator, user, authtoken).
              return (parsed, None)
  
      def _authenticate(self):
          """
        Attempt to authenticate the request using each authentication instance
        in turn.
        Returns a three-tuple of (authenticator, user, authtoken).
        Attempt to authenticate the request using each authentication instance
        in turn.
        Returns a three-tuple of (authenticator, user, authtoken).
          """
          for authenticator in self.authenticators:
              user_auth_tuple = authenticator.authenticate(self)
              if not user_auth_tuple is None:
                  return user_auth_tuple
keep keep keep keep replace replace keep keep keep keep keep
 Implementing 401 vs 403 responses 
rest_framework/request.py