'Extract and normalize project information from auth dict.
:param auth: Dictionary representing the authentication request.
:returns: A string representing the project in the authentication
request. If project scope isn\'t present in the request None
is returned.'

def _get_project_id_from_auth(self, auth):

    project_id = auth.get('tenantId')
    project_name = auth.get('tenantName')
    if project_id:
        if (len(project_id) > CONF.max_param_size):
            raise exception.ValidationSizeError(attribute='tenantId', size=CONF.max_param_size)
    elif project_name:
        if (len(project_name) > CONF.max_param_size):
            raise exception.ValidationSizeError(attribute='tenantName', size=CONF.max_param_size)
        if ((CONF.resource.project_name_url_safe == 'strict') and utils.is_not_url_safe(project_name)):
            msg = _('Tenant    name    cannot    contain    reserved    characters.')
            raise exception.Unauthorized(message=msg)
        try:
            project_id = self.resource_api.get_project_by_name(project_name, CONF.identity.default_domain_id)['id']
        except exception.ProjectNotFound as e:
            raise exception.Unauthorized(e)
    else:
        project_id = None
    return project_id
