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

  1. #1

    Default Authentication 101

    Hi All

    I am new to .NET, this could be a very basic question
    I would like to write a login page to capture username / password, and then
    use window authentication to authenticate the user. I have done some
    readings and come across with IPrinciple, WindowPrinciple .... but can
    someone show me some sample code or a pointer to a documentation showing
    some sample code, on what exactly to be used to perform a basic
    authentication?

    Thankyou very much.
    dl

    --



    Guest

  2. Similar Questions and Discussions

    1. Accessing htm files without authentication (forms authentication)
      I have application with forms authentication. All works fine. When user opens .aspx file gets login form, login and then get the .aspx page. But...
    2. ASP.Net Forms authentication with basic authentication popup
      Relatively new to ASP.Net but have a strange problem. My site uses forms authentication for a large administration section however after the user...
    3. Forms authentication then redirection to a secure web with NT authentication?
      Hi, I want to allow access to particular secured intranet web sites. These intranet are stored in sharepoint (2003 version) Actually I've...
    4. Authentication ticket, cookieless, forms authentication?
      Hi. I want to use Forms Authentication, cookieless. The issue is setting the Authentication Ticket without using cookies (!) That is, the...
    5. Forms authentication with Windows authentication
      Hi, I have an ASP.NET web site that uses IIS Basic Authentication and accesses an OLAP Server at various stages. The OLAP Server authentication...
  3. #2

    Default Re: Authentication 101

    Windows authentication is designed to work with the built-in browser
    features to do authentication, not forms authentication. If you need to,
    you can write your own forms authentication provider to do so, but you'll
    have to do a lot of extra work to get this. Is it really necessary?

    I'd suggest using the LogonUser API or SSPI to create a WindowsPrincipal
    based on a username and password. Both of those will require p/invoke code
    though. There are numerous samples available online.

    Joe K.

    <dl> wrote in message news:OHtDTdAIFHA.2476@TK2MSFTNGP12.phx.gbl...
    > Hi All
    >
    > I am new to .NET, this could be a very basic question
    > I would like to write a login page to capture username / password, and
    > then
    > use window authentication to authenticate the user. I have done some
    > readings and come across with IPrinciple, WindowPrinciple .... but can
    > someone show me some sample code or a pointer to a documentation showing
    > some sample code, on what exactly to be used to perform a basic
    > authentication?
    >
    > Thankyou very much.
    > dl
    >
    > --
    >
    >
    >

    Joe Kaplan \(MVP - ADSI\) Guest

  4. #3

    Default RE: Authentication 101

    Perhaps this will work:
    [url]http://www.codeproject.com/aspnet/ASPdotnet_LoginControl.asp[/url]

    "dl" wrote:
    > Hi All
    >
    > I am new to .NET, this could be a very basic question
    > I would like to write a login page to capture username / password, and then
    > use window authentication to authenticate the user. I have done some
    > readings and come across with IPrinciple, WindowPrinciple .... but can
    > someone show me some sample code or a pointer to a documentation showing
    > some sample code, on what exactly to be used to perform a basic
    > authentication?
    >
    > Thankyou very much.
    > dl
    >
    > --
    >
    >
    >
    >
    jyjohnson Guest

  5. #4

    Default Re: Authentication 101

    Thanks.
    After test driving a sample window authentication, I found I would need the
    form authentication instead, but can I do it using LDAP ...?

    /dl
    "Joe Kaplan (MVP - ADSI)" <joseph.e.kaplan@removethis.accenture.com> wrote
    in message news:%23UaDs8AIFHA.2456@TK2MSFTNGP09.phx.gbl...
    > Windows authentication is designed to work with the built-in browser
    > features to do authentication, not forms authentication. If you need to,
    > you can write your own forms authentication provider to do so, but you'll
    > have to do a lot of extra work to get this. Is it really necessary?
    >
    > I'd suggest using the LogonUser API or SSPI to create a WindowsPrincipal
    > based on a username and password. Both of those will require p/invoke
    code
    > though. There are numerous samples available online.
    >
    > Joe K.
    >
    > <dl> wrote in message news:OHtDTdAIFHA.2476@TK2MSFTNGP12.phx.gbl...
    > > Hi All
    > >
    > > I am new to .NET, this could be a very basic question
    > > I would like to write a login page to capture username / password, and
    > > then
    > > use window authentication to authenticate the user. I have done some
    > > readings and come across with IPrinciple, WindowPrinciple .... but can
    > > someone show me some sample code or a pointer to a documentation showing
    > > some sample code, on what exactly to be used to perform a basic
    > > authentication?
    > >
    > > Thankyou very much.
    > > dl
    > >
    > > --
    > >
    > >
    > >
    >
    >

    Guest

  6. #5

    Default Re: Authentication 101

    Do you want a WindowsPrincipal or are you ok with some type of generic
    IPrincipal? If generic is ok, then you can just use LDAP. I'd still
    suggest going the other route if you can, but that is up to you.

    A quick Google search for Forms authentication and LDAP should turn up some
    of the MS samples. They are not great, but they should get you started.

    I still don't understand what's so important about forms authentication, but
    I guess some people really want that in their applications. I'd rather not
    have all the extra code to worry about if I don't need it, but that's just
    me I guess.

    Joe K.

    <dl> wrote in message news:u14XFFIIFHA.1392@TK2MSFTNGP10.phx.gbl...
    > Thanks.
    > After test driving a sample window authentication, I found I would need
    > the
    > form authentication instead, but can I do it using LDAP ...?
    >
    > /dl
    > "Joe Kaplan (MVP - ADSI)" <joseph.e.kaplan@removethis.accenture.com> wrote
    > in message news:%23UaDs8AIFHA.2456@TK2MSFTNGP09.phx.gbl...
    >> Windows authentication is designed to work with the built-in browser
    >> features to do authentication, not forms authentication. If you need to,
    >> you can write your own forms authentication provider to do so, but you'll
    >> have to do a lot of extra work to get this. Is it really necessary?
    >>
    >> I'd suggest using the LogonUser API or SSPI to create a WindowsPrincipal
    >> based on a username and password. Both of those will require p/invoke
    > code
    >> though. There are numerous samples available online.
    >>
    >> Joe K.
    >>
    >> <dl> wrote in message news:OHtDTdAIFHA.2476@TK2MSFTNGP12.phx.gbl...
    >> > Hi All
    >> >
    >> > I am new to .NET, this could be a very basic question
    >> > I would like to write a login page to capture username / password, and
    >> > then
    >> > use window authentication to authenticate the user. I have done some
    >> > readings and come across with IPrinciple, WindowPrinciple .... but can
    >> > someone show me some sample code or a pointer to a documentation
    >> > showing
    >> > some sample code, on what exactly to be used to perform a basic
    >> > authentication?
    >> >
    >> > Thankyou very much.
    >> > dl
    >> >
    >> > --
    >> >
    >> >
    >> >
    >>
    >>
    >
    >

    Joe Kaplan \(MVP - ADSI\) Guest

  7. #6

    Default Re: Authentication 101

    Joe -- Per a previous post, I can't create a new thread to use the
    user's identity (I think it is always using the aspnet service account
    identity). This thread needs to run a long-running process ( ~5
    minutes) and then write some files out to a share on another server. If
    I try the process without having it run on a new thread it works (well,
    the files are created; I skip the long process so I could test it).

    I've read some things about LogonUser, ReverttoSelf in advapi32, but I
    can't get it to work...

    Any ideas??!! <<Thanks>>

    JYJ Guest

  8. #7

    Default Re: Authentication 101

    This is a limitation of the way Thread.Start works in .NET 1.1. Dominick
    Baier posted a fix that shows how to overcome this by passing the
    WindowsIdentity you want to impersonate as a parameter on Thread.Start and
    then calling WindowsIdentity.Impersonate on it. I'd suggest doing a quick
    Google groups search to find this. It was within the last week.

    You should not need to call LogonUser or RevertToSelf directly within your
    thread code if you have the WindowsIdentity that you want to impersonate
    already.

    HTH,

    Joe K.

    "JYJ" <jonathan.y.johnson@gmail.com> wrote in message
    news:1110307477.674638.84360@o13g2000cwo.googlegro ups.com...
    > Joe -- Per a previous post, I can't create a new thread to use the
    > user's identity (I think it is always using the aspnet service account
    > identity). This thread needs to run a long-running process ( ~5
    > minutes) and then write some files out to a share on another server. If
    > I try the process without having it run on a new thread it works (well,
    > the files are created; I skip the long process so I could test it).
    >
    > I've read some things about LogonUser, ReverttoSelf in advapi32, but I
    > can't get it to work...
    >
    > Any ideas??!! <<Thanks>>
    >

    Joe Kaplan \(MVP - ADSI\) 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