0

I have a project containing an image, css and js folder.
I want to make sure no css, image or js is blocked when using formsauthentication.

I know you can do this with the locationtag in the web.config but I was wondering if you could do this otherweise?

this is how I do it right now:

<location path="css">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization>
        </system.web>
    </location>
    <location path="images">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization>
        </system.web>
    </location>

I'm using asp.net (c#) with iis 7.0.

Cheers, M.

1

3 Answers 3

2

Set the folder permissions for your CSS/images directories, to allows anonymous access.

This is done in the web.config, not filesystem permissions.

Sign up to request clarification or add additional context in comments.

1 Comment

yeah, I know that's what I mentioned in the question. but I wanted to know if there was any other way.
0

It is a good practice to serve static resources such as images and css from a cookie-free domain.

Comments

0

I was seeking the same answer however in my case it is allowing access to CSS, Images and JS files by default. I think it only requires authentication if for ASPX (etc).

Also, I am using deny users "?" rather than "*"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.