def make_error_redirect(self, authorization_error=None):
    """ Return a Django ``HttpResponseRedirect`` describing the request failure.

    If the :py:meth:`validate` method raises an error, the authorization
    endpoint should return the result of calling this method like so:

      >>> auth_code_generator = (
      >>>     AuthorizationCodeGenerator('/oauth2/missing_redirect_uri/'))
      >>> try:
      >>>   auth_code_generator.validate(request)
      >>> except AuthorizationError as authorization_error:
      >>>   return auth_code_generator.make_error_redirect(authorization_error)

    If there is no known Client ``redirect_uri`` (because it is malformed, or
    the Client is invalid, or if the supplied ``redirect_uri`` does not match
    the regsitered value, or some other request failure) then the response will
    redirect to the ``missing_redirect_uri`` passed to the :py:meth:`__init__`
    method.

    Also used to signify user denial; call this method without passing in the
    optional ``authorization_error`` argument to return a generic
    :py:class:`AccessDenied` message.

      >>> if not user_accepted_request:
      >>>   return auth_code_generator.make_error_redirect()

    """
    if not self.redirect_uri:
      return HttpResponseRedirect(self.missing_redirect_uri)

    authorization_error = (authorization_error or
                           AccessDenied('user denied the request'))
    response_params = get_error_details(authorization_error)

    # From http://tools.ietf.org/html/rfc6749#section-4.1.2.1 :
    #
    #     REQUIRED if the "state" parameter was present in the client
    #     authorization request.  The exact value received from the
    #     client.
    #
    if self.state is not None:
      response_params['state'] = self.state
    return HttpResponseRedirect(
        update_parameters(self.redirect_uri, response_params))
def make_error_redirect ( self , authorization_error = None ) : if not self . redirect_uri : return HttpResponseRedirect ( self . missing_redirect_uri ) authorization_error = ( authorization_error or AccessDenied ( 'user denied the request' ) ) response_params = get_error_details ( authorization_error ) if self . state is not None : response_params [ 'state' ] = self . state return HttpResponseRedirect ( update_parameters ( self . redirect_uri , response_params ) )
Return a Django ``HttpResponseRedirect`` describing the request failure.

    If the :py:meth:`validate` method raises an error, the authorization
    endpoint should return the result of calling this method like so:

      >>> auth_code_generator = (
      >>>     AuthorizationCodeGenerator('/oauth2/missing_redirect_uri/'))
      >>> try:
      >>>   auth_code_generator.validate(request)
      >>> except AuthorizationError as authorization_error:
      >>>   return auth_code_generator.make_error_redirect(authorization_error)

    If there is no known Client ``redirect_uri`` (because it is malformed, or
    the Client is invalid, or if the supplied ``redirect_uri`` does not match
    the regsitered value, or some other request failure) then the response will
    redirect to the ``missing_redirect_uri`` passed to the :py:meth:`__init__`
    method.

    Also used to signify user denial; call this method without passing in the
    optional ``authorization_error`` argument to return a generic
    :py:class:`AccessDenied` message.

      >>> if not user_accepted_request:
      >>>   return auth_code_generator.make_error_redirect()