Directory based authentication

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: Directory based authentication

    You can go for form authentication or windows authentication, then use
    location tag or create web.config (in that folder) to specify particular
    permission for specific folder using role based authorization. For example
    to set permission to particular folder using location tag,
    <location path="<foldername>">
    <system.web>
    <autorization>
    <allow users="Admin">
    <deny users="*">
    </autorization>
    </system.web>
    </location>


    --
    Saravana
    Microsoft India Community Star,
    MCAD,SE,SD,DBA.


    "See Sharp" <smitha@inapp.com> wrote in message
    news:#Ud$xI1TDHA.2188@TK2MSFTNGP11.phx.gbl...
    > Hello all,
    >
    > I have a set of admin pages which are put in a subfolder called admin
    inside
    > my application folder.
    > I want to limit access to these admin pages.
    > How can I do this?
    >
    > In Linux, I can password protect the directory, so that whenever a page
    > within the admin subfolder is accessed for the first time, an
    authentication
    > window pops up asking for username-password. How can I implement the same
    > in IIS ?
    >
    > This way I can avoid having to programmatically implement login feature.
    >
    > Can anyone please throw light on this ?
    >
    > Thanks
    > SeeSharp.
    >
    >

    Saravana Guest

  2. Similar Questions and Discussions

    1. CPS + File-based User Directory
      Hi, As part of a test for an organisation I'm contracted to at the moment we're evaluating CPS. The plan is to eventually implement it utilising...
    2. Role based Forms Authentication (using Active Directory)
      Hi All, Can anybody here kindly forward me a sample of a Role based forms Authentication using Acitve Directory? Thanks alot. P
    3. Active Directory Role-Based Authentication Fails for Users - Local
      Developed a web-based application that queries active directory for roles to associate the appropriate functionality to the user. After a recent...
    4. Forms-based Authentication
      HI I'm using Forms-based Authentication and trying out the example from the book: "ASP.NET Professional Secrets" after downloading the c# code...
    5. SSH Host Based Authentication
      Hello, I am having a problem with activating SSHD Host Based Authentication on my FreeBSD OS. Below is my /etc/ssh/sshd_config file. ...
  3. #2

    Default Re: Directory based authentication

    Have set integrated authentication or basic authentication in IIS. So first
    set its authentication mode in IIS,then enable impersonation in web.config.
    Then try, it should work.

    --
    Saravana
    Microsoft India Community Star,
    MCAD,SE,SD,DBA.


    "See Sharp" <smitha@inapp.com> wrote in message
    news:e9fX152TDHA.2228@tk2msftngp13.phx.gbl...
    > Thanks Saravana,
    >
    > But I still get problems. Its shows an access denied problem.
    > I have a parent directory called app. I configured it as a virtual
    > directory.
    > I use the IIS configuration tool from control panel, right click app ->
    all
    > tasks -> permission wizard -> select new security settings -> public
    > website.
    > Now I can access the pages in app folder as
    [url]http://localhost/app/index1.aspx[/url]
    > In the web.config of the app folder I have the following data:
    > ************************************************** ********
    > <?xml version="1.0" encoding="utf-8" ?>
    > <configuration>
    > <system.web>
    >
    > <compilation defaultLanguage="c#" debug="true" />
    > <customErrors mode="RemoteOnly" />
    > <authentication mode="Windows" />
    > <trace enabled="false" requestLimit="10" pageOutput="false"
    > traceMode="SortByTime" localOnly="true" />
    > <sessionState mode="InProc"
    stateConnectionString="tcpip=127.0.0.1:42424"
    > sqlConnectionString="data source=127.0.0.1;user id=sa;password="
    > cookieless="false" timeout="20" />
    > <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
    > </system.web>
    > <location path="admin">
    > <system.web>
    > <authorization>
    > <allow users="abcd" />
    > <deny users="*" />
    > </authorization>
    > </system.web>
    > </location>
    > </configuration>
    > ****************************
    >
    > I have a subfolder admin in my app folder.
    > Actually I made it as another application and copied the application's
    > folder as a subfolder called admin in my app folder.
    > The admin folder therefore has a web.config too.
    > But I deleted it so that there is no ambiguity.
    > I have not made the admin subfolder as a virtual directory.
    >
    > Now with the above security settings, I should get the the files in the
    > admin folder as [url]http://localhost/app/admin/index1.aspx[/url]
    > It should ask for authentication and when I enter the username password of
    > user abcd, it should let me in.
    > But This does not happen.
    > I get an error.
    > I tried making the admin subfolder as a virtual directory.
    > I even tried to retain its web.config and place this within it:
    > <authorization>
    > <allow users="abcd" />
    > <deny users="*" />
    > </authorization>
    > In that case it works, but it allows all users in.
    > Not abcd alone.
    >
    > Can you please throw light on this ?
    > Thanks a lot
    > SeeSharp.
    >
    > "Saravana" <saravank@sct.co.in> wrote in message
    > news:OcoqLV1TDHA.1664@TK2MSFTNGP11.phx.gbl...
    > > You can go for form authentication or windows authentication, then use
    > > location tag or create web.config (in that folder) to specify
    particular
    > > permission for specific folder using role based authorization. For
    example
    > > to set permission to particular folder using location tag,
    > > <location path="<foldername>">
    > > <system.web>
    > > <autorization>
    > > <allow users="Admin">
    > > <deny users="*">
    > > </autorization>
    > > </system.web>
    > > </location>
    > >
    > >
    > > --
    > > Saravana
    > > Microsoft India Community Star,
    > > MCAD,SE,SD,DBA.
    > >
    > >
    > > "See Sharp" <smitha@inapp.com> wrote in message
    > > news:#Ud$xI1TDHA.2188@TK2MSFTNGP11.phx.gbl...
    > > > Hello all,
    > > >
    > > > I have a set of admin pages which are put in a subfolder called admin
    > > inside
    > > > my application folder.
    > > > I want to limit access to these admin pages.
    > > > How can I do this?
    > > >
    > > > In Linux, I can password protect the directory, so that whenever a
    page
    > > > within the admin subfolder is accessed for the first time, an
    > > authentication
    > > > window pops up asking for username-password. How can I implement the
    > same
    > > > in IIS ?
    > > >
    > > > This way I can avoid having to programmatically implement login
    feature.
    > > >
    > > > Can anyone please throw light on this ?
    > > >
    > > > Thanks
    > > > SeeSharp.
    > > >
    > > >
    > >
    > >
    >
    >

    Saravana Guest

  4. #3

    Default Re: Directory based authentication

    Please fix the date on your computer.


    Steve C. Orr, MCSD Guest

  5. #4

    Default Re: Directory based authentication

    Yup. I did that. I am sorry. I used the calendar to choose a relieving date
    [ I am planning to resign from my job next month].
    And I accidently clicked OK :">

    SeeSharp

    "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    news:ugC$HmLUDHA.1740@TK2MSFTNGP12.phx.gbl...
    > Please fix the date on your computer.
    >
    >

    See Sharp Guest

  6. #5

    Default Re: Directory based authentication

    Hi SeeSharp,

    I am an application that does EXACTLY the same as you - an admin folder with
    admin pages that is restricted to a select few. Have you managed to get
    your application to work as you wanted? If so, I would be very interested
    to know how you did it. Authentication is something I have not yet
    mastered.

    Cheers,

    Paul Hobbs



    "See Sharp" <smitha@inapp.com> wrote in message
    news:#Ud$xI1TDHA.2188@TK2MSFTNGP11.phx.gbl...
    > Hello all,
    >
    > I have a set of admin pages which are put in a subfolder called admin
    inside
    > my application folder.
    > I want to limit access to these admin pages.
    > How can I do this?
    >
    > In Linux, I can password protect the directory, so that whenever a page
    > within the admin subfolder is accessed for the first time, an
    authentication
    > window pops up asking for username-password. How can I implement the same
    > in IIS ?
    >
    > This way I can avoid having to programmatically implement login feature.
    >
    > Can anyone please throw light on this ?
    >
    > Thanks
    > SeeSharp.
    >
    >

    Paul Hobbs Guest

  7. #6

    Default Re: Directory based authentication

    Hi Paul

    I disabled anonymous logon to my admin directory. In the access control
    list, I add each member whom I want to deny [including anonymous] and deny
    all rights to them. The everyone user has all "required" permissions.

    SeeSharp

    "Paul Hobbs" <paul@mobius.net.au> wrote in message
    news:#RHABFtUDHA.2328@TK2MSFTNGP12.phx.gbl...
    > Hi SeeSharp,
    >
    > I am an application that does EXACTLY the same as you - an admin folder
    with
    > admin pages that is restricted to a select few. Have you managed to get
    > your application to work as you wanted? If so, I would be very interested
    > to know how you did it. Authentication is something I have not yet
    > mastered.
    >
    > Cheers,
    >
    > Paul Hobbs
    >
    >
    >
    > "See Sharp" <smitha@inapp.com> wrote in message
    > news:#Ud$xI1TDHA.2188@TK2MSFTNGP11.phx.gbl...
    > > Hello all,
    > >
    > > I have a set of admin pages which are put in a subfolder called admin
    > inside
    > > my application folder.
    > > I want to limit access to these admin pages.
    > > How can I do this?
    > >
    > > In Linux, I can password protect the directory, so that whenever a page
    > > within the admin subfolder is accessed for the first time, an
    > authentication
    > > window pops up asking for username-password. How can I implement the
    same
    > > in IIS ?
    > >
    > > This way I can avoid having to programmatically implement login feature.
    > >
    > > Can anyone please throw light on this ?
    > >
    > > Thanks
    > > SeeSharp.
    > >
    > >
    >
    >

    See Sharp Guest

  8. #7

    Default Re: Directory based authentication

    AuthentiX passwords protects directories and files.

    [url]http://www.flicks.com/prod.htm#authnx[/url]




    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Scott Scott Guest

  9. #8

    Default Re: Directory based authentication

    What sets the current "user"? For example how do I know if the person is
    "Admin"? Where is that set?

    "Saravana" <saravank@sct.co.in> wrote in message
    news:OcoqLV1TDHA.1664@TK2MSFTNGP11.phx.gbl...
    > You can go for form authentication or windows authentication, then use
    > location tag or create web.config (in that folder) to specify particular
    > permission for specific folder using role based authorization. For example
    > to set permission to particular folder using location tag,
    > <location path="<foldername>">
    > <system.web>
    > <autorization>
    > <allow users="Admin">
    > <deny users="*">
    > </autorization>
    > </system.web>
    > </location>
    >
    >
    > --
    > Saravana
    > Microsoft India Community Star,
    > MCAD,SE,SD,DBA.
    >
    >
    > "See Sharp" <smitha@inapp.com> wrote in message
    > news:#Ud$xI1TDHA.2188@TK2MSFTNGP11.phx.gbl...
    > > Hello all,
    > >
    > > I have a set of admin pages which are put in a subfolder called admin
    > inside
    > > my application folder.
    > > I want to limit access to these admin pages.
    > > How can I do this?
    > >
    > > In Linux, I can password protect the directory, so that whenever a page
    > > within the admin subfolder is accessed for the first time, an
    > authentication
    > > window pops up asking for username-password. How can I implement the
    same
    > > in IIS ?
    > >
    > > This way I can avoid having to programmatically implement login feature.
    > >
    > > Can anyone please throw light on this ?
    > >
    > > Thanks
    > > SeeSharp.
    > >
    > >
    >
    >

    VB Programmer Guest

  10. #9

    Default Re: Directory based authentication

    You assign roles to each user. This has to be done on each request. You set
    Context.User to a new GenericPrincipal, and assign roles at the same time.
    Then you can check using User.IsInRole.

    The downside is, obviousely, that you must create a new user on each
    request. A better way would be to save all this information in the Session
    object. But unfortunately that data isn't accessible from within any of the
    Application_Request* events in global.asax. So you basically need to include
    a file for checking in every page.

    /john

    "VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
    news:uyn1$M5WDHA.2388@TK2MSFTNGP11.phx.gbl...
    > What sets the current "user"? For example how do I know if the person is
    > "Admin"? Where is that set?
    >
    > "Saravana" <saravank@sct.co.in> wrote in message
    > news:OcoqLV1TDHA.1664@TK2MSFTNGP11.phx.gbl...
    > > You can go for form authentication or windows authentication, then use
    > > location tag or create web.config (in that folder) to specify
    particular
    > > permission for specific folder using role based authorization. For
    example
    > > to set permission to particular folder using location tag,
    > > <location path="<foldername>">
    > > <system.web>
    > > <autorization>
    > > <allow users="Admin">
    > > <deny users="*">
    > > </autorization>
    > > </system.web>
    > > </location>
    > >
    > >
    > > --
    > > Saravana
    > > Microsoft India Community Star,
    > > MCAD,SE,SD,DBA.
    > >
    > >
    > > "See Sharp" <smitha@inapp.com> wrote in message
    > > news:#Ud$xI1TDHA.2188@TK2MSFTNGP11.phx.gbl...
    > > > Hello all,
    > > >
    > > > I have a set of admin pages which are put in a subfolder called admin
    > > inside
    > > > my application folder.
    > > > I want to limit access to these admin pages.
    > > > How can I do this?
    > > >
    > > > In Linux, I can password protect the directory, so that whenever a
    page
    > > > within the admin subfolder is accessed for the first time, an
    > > authentication
    > > > window pops up asking for username-password. How can I implement the
    > same
    > > > in IIS ?
    > > >
    > > > This way I can avoid having to programmatically implement login
    feature.
    > > >
    > > > Can anyone please throw light on this ?
    > > >
    > > > Thanks
    > > > SeeSharp.
    > > >
    > > >
    > >
    > >
    >
    >

    John Knoop Guest

  11. #10

    Default Directory based authentication

    Hello all,

    I have a set of admin pages which are put in a subfolder called admin inside
    my application folder.
    I want to limit access to these admin pages.
    How can I do this?

    In Linux, I can password protect the directory, so that whenever a page
    within the admin subfolder is accessed for the first time, an authentication
    window pops up asking for username-password. How can I implement the same
    in IIS ?

    This way I can avoid having to programmatically implement login feature.

    Can anyone please throw light on this ?

    Thanks
    SeeSharp.


    See Sharp Guest

  12. #11

    Default Re: Directory based authentication

    Thanks Saravana,

    But I still get problems. Its shows an access denied problem.
    I have a parent directory called app. I configured it as a virtual
    directory.
    I use the IIS configuration tool from control panel, right click app -> all
    tasks -> permission wizard -> select new security settings -> public
    website.
    Now I can access the pages in app folder as [url]http://localhost/app/index1.aspx[/url]
    In the web.config of the app folder I have the following data:
    ************************************************** ********
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    <system.web>

    <compilation defaultLanguage="c#" debug="true" />
    <customErrors mode="RemoteOnly" />
    <authentication mode="Windows" />
    <trace enabled="false" requestLimit="10" pageOutput="false"
    traceMode="SortByTime" localOnly="true" />
    <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"
    sqlConnectionString="data source=127.0.0.1;user id=sa;password="
    cookieless="false" timeout="20" />
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
    </system.web>
    <location path="admin">
    <system.web>
    <authorization>
    <allow users="abcd" />
    <deny users="*" />
    </authorization>
    </system.web>
    </location>
    </configuration>
    ****************************

    I have a subfolder admin in my app folder.
    Actually I made it as another application and copied the application's
    folder as a subfolder called admin in my app folder.
    The admin folder therefore has a web.config too.
    But I deleted it so that there is no ambiguity.
    I have not made the admin subfolder as a virtual directory.

    Now with the above security settings, I should get the the files in the
    admin folder as [url]http://localhost/app/admin/index1.aspx[/url]
    It should ask for authentication and when I enter the username password of
    user abcd, it should let me in.
    But This does not happen.
    I get an error.
    I tried making the admin subfolder as a virtual directory.
    I even tried to retain its web.config and place this within it:
    <authorization>
    <allow users="abcd" />
    <deny users="*" />
    </authorization>
    In that case it works, but it allows all users in.
    Not abcd alone.

    Can you please throw light on this ?
    Thanks a lot
    SeeSharp.

    "Saravana" <saravank@sct.co.in> wrote in message
    news:OcoqLV1TDHA.1664@TK2MSFTNGP11.phx.gbl...
    > You can go for form authentication or windows authentication, then use
    > location tag or create web.config (in that folder) to specify particular
    > permission for specific folder using role based authorization. For example
    > to set permission to particular folder using location tag,
    > <location path="<foldername>">
    > <system.web>
    > <autorization>
    > <allow users="Admin">
    > <deny users="*">
    > </autorization>
    > </system.web>
    > </location>
    >
    >
    > --
    > Saravana
    > Microsoft India Community Star,
    > MCAD,SE,SD,DBA.
    >
    >
    > "See Sharp" <smitha@inapp.com> wrote in message
    > news:#Ud$xI1TDHA.2188@TK2MSFTNGP11.phx.gbl...
    > > Hello all,
    > >
    > > I have a set of admin pages which are put in a subfolder called admin
    > inside
    > > my application folder.
    > > I want to limit access to these admin pages.
    > > How can I do this?
    > >
    > > In Linux, I can password protect the directory, so that whenever a page
    > > within the admin subfolder is accessed for the first time, an
    > authentication
    > > window pops up asking for username-password. How can I implement the
    same
    > > in IIS ?
    > >
    > > This way I can avoid having to programmatically implement login feature.
    > >
    > > Can anyone please throw light on this ?
    > >
    > > Thanks
    > > SeeSharp.
    > >
    > >
    >
    >

    See Sharp Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139