Question: I'm new to apache so sorry if this is a newbie question. I have a reverse proxy set-up (and working) with the following code which includes a working authentication:

```
<VirtualHost *:80>

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

ProxyPass /PIZZA/ http://localhost:3636/PIZZA/
ProxyPassReverse /PIZZA/ http://localhost:3636/PIZZA/
ProxyPreserveHost On

<Location /PIZZA/>
AuthUserFile /etc/USER_PWD/PIZZA_PWD
AuthName "Password Protected"
AuthType Basic
require valid-user
</Location>

</VirtualHost>

```

The above authentication is working if I go do my /PIZZA/ url. 

However, if I type in the source IP address for the same url (ex: 192.168.1.11:3636/PIZZA/) the webpage loads without the need for authentication.

My question, is there a way to authenticate the specific source ip address? Something like the following (which doesn't work)?

```
<Location http://192.168.1.11:3636/PIZZA/>
AuthUserFile /etc/USER_PWD/PIZZA_PWD
AuthName "Password Protected"
AuthType Basic
require valid-user
</Location>

```

Any help would be very much appreciated. Thanks!

Answer: 
I ended up implementing a custom attribute to do this.

```
public class ColumnWeight : Attribute
    {
        public int Weight { get; set; }

        public ColumnWeight(int weight)
        {
            Weight = weight;
        }
}

```

And then I can just override the OnColumnAdded method of my DataGridView to grab the attribute and set the FillWeight for the column.

```
protected override void OnColumnAdded(DataGridViewColumnEventArgs e)
{
    // Get the property object based on the DataPropertyName of the column
    var property = typeof(SyncDetail).GetProperty(e.Column.DataPropertyName);
    // Get the ColumnWeight attribute from the property if it exists
    var weightAttribute = (ColumnWeight)property.GetCustomAttribute(typeof(ColumnWeight));
    if (weightAttribute != null)
    {
        // Finally, set the FillWeight of the column to our defined weight in the attribute
        e.Column.FillWeight = weightAttribute.Weight;
    }
    base.OnColumnAdded(e);
}

```

Then I can just set the attribute on my properties of my object.

```
public class SyncDetail : ISyncDetail
{

    // Browsable properties

    [DisplayName("Sync Name")]
    [ColumnWeight(20)]
    public string Name { get; set; }

    etc...
}

```
Based on your original answer I made something with a *slightly* expanded use case that can be used with multiple datagrids bound to different Column properties that are backed with an integer value.

Example usage with Width and MinimumWidth properties in a SyncDetails class:

```
    [ColumnProperty("MinimumWidth",100)]
    [ColumnProperty("Width",250 )]
    public string Name{get;set;}

```

Then my attribute definition is updated to allow multiple attributes:

```
[AttributeUsage(AttributeTargets.All, AllowMultiple = true)]
public class ColumnPropertyAttribute:Attribute
{
    public string ColumnPropertyName { get; set; }
    public int ColumnValue { get; set; }

    public ColumnPropertyAttribute(string columnPropertyName, int columnValue)
    {
        ColumnValue = columnValue;
        ColumnPropertyName = columnPropertyName;
    }
}

```

On the \_ColumnAdded event, we do a lookup of whatever type the datagrid was bound to, pull the custom attributes off it then try to apply the value. I bind everything to a `BindingList<T>` so the .GetGenericArguments() returns that type T for the custom attribute lookup but that could be tweaked as needed for other applications.

```
private void DataGridView1_ColumnAdded(object sender, DataGridViewColumnEventArgs e)
{
    try
    {
        var propInfo = (sender as DataGridView).DataSource.GetType().GetGenericArguments()[0].GetProperty(e.Column.DataPropertyName);
        if (propInfo != null)
        {
            var customAttributes = propInfo.GetCustomAttributes<ColumnPropertyAttribute>();
            foreach (var ca in customAttributes)
            {
                var column = e.Column;
                var propToChange = e.Column.GetType().GetProperty(ca.ColumnPropertyName);
                propToChange.SetValue(column, ca.ColumnValue);
            }
        }
    }
    catch (Exception ex)
    {
        Console.WriteLine("Exception processing custom _ColumnAdded properties: " + ex.Message);
    }
}

```