def METHOD_NAME(self, request):
    """
    :param request: OAuthlib request.
    :type request: oauthlib.common.Request
    """
    for validator in self.custom_validators.pre_token:
        validator(request)
    if not getattr(request, 'grant_type', None):
        raise errors.InvalidRequestError('Request is missing grant type.',
                                         request=request)
    if not request.grant_type == 'client_credentials':
        raise errors.UnsupportedGrantTypeError(request=request)
    for param in ('grant_type', 'scope'):
        if param in request.duplicate_params:
            raise errors.InvalidRequestError(description='Duplicate %s parameter.' % param,
                                             request=request)
    log.debug('Authenticating client, %r.', request)
    if not self.request_validator.authenticate_client(request):
        log.debug('Client authentication failed, %r.', request)
        raise errors.InvalidClientError(request=request)
    else:
        if not hasattr(request.client, 'client_id'):
            raise NotImplementedError('Authenticate client must set the '
                                      'request.client.client_id attribute '
                                      'in authenticate_client.')
    # Ensure client is authorized use of this grant type
    self.validate_grant_type(request)
    request.client_id = request.client_id or request.client.client_id
    log.debug('Authorizing access to client %r.', request.client_id)
    self.validate_scopes(request)
    for validator in self.custom_validators.post_token:
        validator(request)