Beginners question: Form based authentication

O

Oliver Kharraz

Hello,

the following question may be trivial, but after scrolling documentations on
my screen for hours I'd absolutely appreciate your help:

I want to have two kind of pages on my site: the ones everyone can access
(allow users="*" in the web.config) and those that require forms based
authentication (allow users="?" in the web config). How do I set it up so
that the IIS knows which page uses which setting? In the Visual Basic. net
documentation, it says it can be done page specific, but does not give an
example.

Thank you so much,

Oliver
 
E

Eric Marvets

Choose whichever section will have more pages. For that section, set up the
config file as you normally would. After the normal '</system.web>' add the
following for each page:

<location path="Logon.aspx">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>

In there, you can specify all the <system.web> settings again for that page.

It is better to configure this by directory, as setting up a <location> for
a number of pages can be difficult to maintain, vs. one web.config file per
subdirectory.

--
Eric Marvets
Principal Consultant

the bang project

<shameless self promotion>

Email (e-mail address removed) for Information on Our Architecture and
Mentoring Services

</shameless self promotion>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top