code: def _raise_on_invalid_client(self, request):
          
          if self.request_validator.client_authentication_required(request):
              if not self.request_validator.authenticate_client(request):
                  log.debug('Client authentication failed, %r.', request)
                  raise InvalidClientError(request=request)
          elif not self.request_validator.authenticate_client_id(request.client_id, request):
              log.debug('Client authentication failed, %r.', request)
              raise InvalidClientError(request=request)
docs: Raise on failed client authentication.