code: def verify_request(self):
          
          request = self.lti_kwargs['app'].current_request
          if request.method == 'POST':
              # Chalice expects JSON and does not nativly support forms data in
              # a post body. The below is copied from the parsing of query
              # strings as implimented in match_route of Chalice local.py
              parsed_url = request.raw_body.decode()
              parsed_qs = parse_qs(parsed_url, keep_blank_values=True)
              params = {k: v[0] for k, v in parsed_qs .items()}
          else:
              params = request.query_params
          log.debug(params)
          log.debug('verify_request?')
          try:
              # Chalice does not have a url property therefore building it.
              protocol = request.headers.get('x-forwarded-proto', 'http')
              hostname = request.headers['host']
              path = request.context['path']
              url = urlunparse((protocol, hostname, path, "", "", ""))
              verify_request_common(self._consumers(), url,
                                    request.method, request.headers,
                                    params)
              log.debug('verify_request success')
  
              # All good to go, store all of the LTI params into a
              # session dict for use in views
              for prop in LTI_PROPERTY_LIST:
                  if params.get(prop, None):
                      log.debug("params %s=%s", prop, params.get(prop, None))
                      self.session[prop] = params[prop]
  
              # Set logged in session key
              self.session[LTI_SESSION_KEY] = True
              return True
          except LTIException:
              log.debug('verify_request failed')
              for prop in LTI_PROPERTY_LIST:
                  if self.session.get(prop, None):
                      del self.session[prop]
  
              self.session[LTI_SESSION_KEY] = False
              raise
docs: Verify LTI request
  
          :raises: LTIException if request validation failed