RE: Help needed in Web.config

From: ranganh (ranganh_at_discussions.microsoft.com)
Date: 09/04/04


Date: Sat, 4 Sep 2004 08:49:01 -0700

Hi,

You need to put the locationpath tag outside the system.web tag in your
web.config.

your web.config stars like this

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>

// here you specify the authentication mode

</system.web>

//here you need to put the location path tag

<location path="ProtectedPage.aspx">
    <system.web>
      <authorization>
        <deny users="?" />
        <deny users="sa" />
      </authorization>
    </system.web>
</location>

Notice that the above tag set themselves have a system.web tag. so they
need to be outside the original <system.web>... </system.web> tags. in your
web.config file.

"Raghu Raman" wrote:

>
>
> Hi, thanks for that. but i did not get he result for that.it spits the
> error for the <location > tag.
>
> your suggestion
> --------------------------
> <location path="ProtectedPage.aspx">
> <system.web>
> <authorization>
> <deny users="?" />
> <deny users="sa" />
> </authorization>
> </system.web>
> </location>
> ------------------------------
>
> may be i am wrong in understanding of the web.config.
> --------------------------------
> let me clear on web.config
> --------------------------------
> 1.the users tag in the web.config denotes the windows user account only
> ..
> 2. it does not denotes the any database users.
>
> 3. for 'forms' based authentication, since some of my pages of my web
> has to be seen , i should go for Anonymous authentication alone (or
> combined with Integrated windows Authentication) .
>
> 4.Now i need to do nothing with the web.config. am i right???
>
> 5.THEN HOW DO I RESTRICT THE DATABASE USERS.
>
>
> ***IS IT POSSIBLE TO RESTRICT DATABASE USERS IN WEB.CONFIG?**
>
> With regards
> Raghuraman
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
>



Relevant Pages

  • RE: Help needed in Web.config
    ... error for the tag. ... 1.the users tag in the web.config denotes the windows user account only ... for 'forms' based authentication, since some of my pages of my web ... 5.THEN HOW DO I RESTRICT THE DATABASE USERS. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: ASP.NET Authentication exception case
    ... It doesn't seem to like the authorization tag underneath the location tag ... This section sets the authentication policies of the application. ... <!-- SESSION STATE SETTINGS ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: can I set web.config to require authentication only for some files?
    ... correctly (it had to go just before the closing tag ... one authentication method for one set of pages and a different ... that always gave a run-time error. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: can I set web.config to require authentication only for some files?
    ... You can specify some pages to require login, and others to not require login ... via your web.config file by using the tag. ... > What if I want to configure authentication so that it's only required ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Page level forms Authentication
    ... By setting authentication normally as you would and then the alternative ... tag as it would normally be with Forms auth. ... I also have 3 more in the root> directory that must be available to everyone. ...
    (microsoft.public.dotnet.framework.aspnet.security)