'Check the token request for normal and fatal errors.
This method is very similar to validate_authorization_request in
the AuthorizationCodeGrant but differ in a few subtle areas.
A normal error could be a missing response_type parameter or the client
attempting to access scope it is not allowed to ask authorization for.
Normal errors can safely be included in the redirection URI and
sent back to the client.
Fatal errors occur when the client_id or redirect_uri is invalid or
missing. These must be caught by the provider and handled, how this
is done is outside of the scope of OAuthLib but showing an error
page describing the issue is a good idea.'

def validate_token_request(self, request):

    for param in (u'client_id', u'response_type', u'redirect_uri', u'scope', u'state'):
        try:
            duplicate_params = request.duplicate_params
        except ValueError:
            raise errors.InvalidRequestFatalError(description=u'Unable    to    parse    query    string', request=request)
        if (param in duplicate_params):
            raise errors.InvalidRequestFatalError(description=(u'Duplicate    %s    parameter.' % param), request=request)
    if (not request.client_id):
        raise errors.MissingClientIdError(request=request)
    if (not self.request_validator.validate_client_id(request.client_id, request)):
        raise errors.InvalidClientIdError(request=request)
    if (request.redirect_uri is not None):
        request.using_default_redirect_uri = False
        log.debug(u'Using    provided    redirect_uri    %s', request.redirect_uri)
        if (not is_absolute_uri(request.redirect_uri)):
            raise errors.InvalidRedirectURIError(request=request)
        if (not self.request_validator.validate_redirect_uri(request.client_id, request.redirect_uri, request)):
            raise errors.MismatchingRedirectURIError(request=request)
    else:
        request.redirect_uri = self.request_validator.get_default_redirect_uri(request.client_id, request)
        request.using_default_redirect_uri = True
        log.debug(u'Using    default    redirect_uri    %s.', request.redirect_uri)
        if (not request.redirect_uri):
            raise errors.MissingRedirectURIError(request=request)
        if (not is_absolute_uri(request.redirect_uri)):
            raise errors.InvalidRedirectURIError(request=request)
    if (request.response_type is None):
        raise errors.MissingResponseTypeError(request=request)
    elif (request.response_type != u'token'):
        raise errors.UnsupportedResponseTypeError(request=request)
    log.debug(u'Validating    use    of    response_type    token    for    client    %r    (%r).', request.client_id, request.client)
    if (not self.request_validator.validate_response_type(request.client_id, request.response_type, request.client, request)):
        log.debug(u'Client    %s    is    not    authorized    to    use    response_type    %s.', request.client_id, request.response_type)
        raise errors.UnauthorizedClientError(request=request)
    self.validate_scopes(request)
    return (request.scopes, {u'client_id': request.client_id, u'redirect_uri': request.redirect_uri, u'response_type': request.response_type, u'state': request.state, u'request': request})
