code: def process_resource(self, req, resp, resource, uri_kwargs=None):
          
          if 'user' in req.context:
              return
  
          identifier = self.identify(req, resp, resource, uri_kwargs)
          user = self.try_storage(identifier, req, resp, resource, uri_kwargs)
  
          if user is not None:
              req.context['user'] = user
  
          # if did not succeed then we need to add this to list of available
          # challenges.
          elif self.challenge is not None:
              req.context.setdefault(
                  'challenges', list()
              ).append(self.challenge)
docs: Process resource after routing to it.
  
          This is basic falcon middleware handler.
  
          Args:
              req (falcon.Request): request object
              resp (falcon.Response): response object
              resource (object): resource object matched by falcon router
              uri_kwargs (dict): additional keyword argument from uri template.
                  For ``falcon<1.0.0`` this is always ``None``