web.config and location...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Natan

    web.config and location...

    I have an directory structure like this:

    localhost/site/myapp
    localhost/site/myapp/author/
    localhost/site/myapp/revisor/
    localhost/site/myapp/editor/
    localhost/site/myapp/admin/

    myapp is an application and is where my web.config is located. I must
    create 4 completely separated areas for authors, revisors, and editor
    and an admin. The 4 areas will be completely different, so i put each of
    them in a different folder.

    So, each of the 4 folders have a login form, the user authenticates and
    can do his job. I am trying to use the Form Authentication that ASP.NET
    provides, but i don`t want an user authenticated for "author" to have
    access to "revisor" area... or an "editor" have access to "admin". there
    are no privilegies, no admin will access author area. So each folder
    will have it`s own authentication.

    I tried this:

    [localhost/site/myapp/web.config]
    <configuratio n>
    <location path="author">
    <authenticati on mode="Forms">
    <forms name="AUTHOR_AU TH" loginUrl="~/author/login.aspx" />
    </authentication>
    <authorizatio n>
    <deny users="?">
    </authorization>
    </location>

    <location path="revisor">
    <authenticati on mode="Forms">
    <forms name="REVISOR_A UTH" loginUrl="~/revisor/login.aspx" />
    </authentication>
    <authorizatio n>
    <deny users="?">
    </authorization>
    </location>

    <and etc="... =)"/>
    </configuration>

    but it`s not redirecting to the login page.. i can enter any folder
    always. I don`t know if my web.config is wrong, or Windows
    Authentication comes first to authorize...

    anyone can help?
    thanks...
  • Curt_C [MVP]

    #2
    Re: web.config and location...

    you can only have one auth method per site/vd.
    You will have to create each with its own virtual dir if you want it to have
    it's own auth
    Otherwise, have them login at the top level, and control auth based on
    groups,id's,etc

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software



    "Natan" <nvivo@mandic.c om.br> wrote in message
    news:ektd75wIEH A.3432@tk2msftn gp13.phx.gbl...[color=blue]
    > I have an directory structure like this:
    >
    > localhost/site/myapp
    > localhost/site/myapp/author/
    > localhost/site/myapp/revisor/
    > localhost/site/myapp/editor/
    > localhost/site/myapp/admin/
    >
    > myapp is an application and is where my web.config is located. I must
    > create 4 completely separated areas for authors, revisors, and editor
    > and an admin. The 4 areas will be completely different, so i put each of
    > them in a different folder.
    >
    > So, each of the 4 folders have a login form, the user authenticates and
    > can do his job. I am trying to use the Form Authentication that ASP.NET
    > provides, but i don`t want an user authenticated for "author" to have
    > access to "revisor" area... or an "editor" have access to "admin". there
    > are no privilegies, no admin will access author area. So each folder
    > will have it`s own authentication.
    >
    > I tried this:
    >
    > [localhost/site/myapp/web.config]
    > <configuratio n>
    > <location path="author">
    > <authenticati on mode="Forms">
    > <forms name="AUTHOR_AU TH" loginUrl="~/author/login.aspx" />
    > </authentication>
    > <authorizatio n>
    > <deny users="?">
    > </authorization>
    > </location>
    >
    > <location path="revisor">
    > <authenticati on mode="Forms">
    > <forms name="REVISOR_A UTH" loginUrl="~/revisor/login.aspx" />
    > </authentication>
    > <authorizatio n>
    > <deny users="?">
    > </authorization>
    > </location>
    >
    > <and etc="... =)"/>
    > </configuration>
    >
    > but it`s not redirecting to the login page.. i can enter any folder
    > always. I don`t know if my web.config is wrong, or Windows
    > Authentication comes first to authorize...
    >
    > anyone can help?
    > thanks...[/color]


    Comment

    • Natan

      #3
      Re: web.config and location...

      Curt_C [MVP] wrote:[color=blue]
      > you can only have one auth method per site/vd.
      > You will have to create each with its own virtual dir if you want it to have
      > it's own auth
      > Otherwise, have them login at the top level, and control auth based on
      > groups,id's,etc[/color]

      what prevents an app from having multiple logins, if you have the
      "location" tag to specify different configs for different directories
      and the cookie path can be changed?

      And how do i disable windows authentication in my app?

      Comment

      • Curt_C [MVP]

        #4
        Re: web.config and location...

        web.config wont allow it, it's part of the asp.net framework I believe. ONE
        auth type per "site/vd". You can override/exclude/include but you can't set
        multiple types

        --
        Curt Christianson
        Owner/Lead Developer, DF-Software



        "Natan" <nvivo@mandic.c om.br> wrote in message
        news:%23WkoHqxI EHA.3572@TK2MSF TNGP10.phx.gbl. ..[color=blue]
        > Curt_C [MVP] wrote:[color=green]
        > > you can only have one auth method per site/vd.
        > > You will have to create each with its own virtual dir if you want it to[/color][/color]
        have[color=blue][color=green]
        > > it's own auth
        > > Otherwise, have them login at the top level, and control auth based on
        > > groups,id's,etc[/color]
        >
        > what prevents an app from having multiple logins, if you have the
        > "location" tag to specify different configs for different directories
        > and the cookie path can be changed?
        >
        > And how do i disable windows authentication in my app?[/color]


        Comment

        Working...