Professional Web Applications Themes

Seamless Login Page with ASP Dotnet - ASP.NET Security

Hi, I'm a little new to ASP Dotnet, but have been coding in classic ASP for over 5 years... I'd appreciate some suggestions/guidance in writing an Intranet login page that authenticates domain users to AD on a Win2003 server. Is it possible to code an .aspx page that will "automatically obtain the login user's creditentials" (User ID and/or P/W) they provided to AD when the user logged into their workstation? When I say "automatically obtain the creditentials" I mean the user does NOT enter any info on the page. The code behind page some how obtains that info via classes ...

  1. #1

    Default Seamless Login Page with ASP Dotnet

    Hi,

    I'm a little new to ASP Dotnet, but have been coding in classic ASP for over
    5 years...

    I'd appreciate some suggestions/guidance in writing an Intranet login page
    that authenticates domain users to AD on a Win2003 server. Is it possible
    to code an .aspx page that will "automatically obtain the login user's
    creditentials" (User ID and/or P/W) they provided to AD when the user logged
    into their workstation? When I say "automatically obtain the creditentials"
    I mean the user does NOT enter any info on the page. The code behind page
    some how obtains that info via classes or objects or the Dotnet Framework.
    I'd like to use that info to re-verify the account that is still active in
    AD via an LDAP lookup. If it is still valid, then allow the user into
    various Intranet websites, thus providing an "Automatic or Seamless" login
    for the users.

    Is something like this possible to do? I thought I read somewhere that it
    was possible with ASP Dotnet and not in classic ASP. Please let me know if
    that is true and a basic plan on how could make it happen.

    Any suggestions would be appreciated. Thanks,
    -Joe


    Joe Rigley Guest

  2. #2

    Default Re: Seamless Login Page with ASP Dotnet

    In order to get the credentials of the user you will have to setup IIS for
    your site as follows:
    1. Disable anonymous access to you site in IIS.
    2. Enable Windows Integrated Authentication.

    In ASP .Net you will need to add the following to web.config:
    <identity impersonate="true" />

    In your code you do the following:
    WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());

    This will create a WindowsPrincipal with the user that is currently logged
    into the domain. If you allow anonymous access or do not impersonate, the
    WindowsPrincipal will be for the account used by ASP .Net. That will either
    be ASPNET or NETWORK SERVICE.

    Chris Rolon


    "Joe Rigley" <jcrigleyspartanmotors.com> wrote in message
    news:Owx6nTUBFHA.2640TK2MSFTNGP14.phx.gbl...
    > Hi,
    >
    > I'm a little new to ASP Dotnet, but have been coding in classic ASP for
    over
    > 5 years...
    >
    > I'd appreciate some suggestions/guidance in writing an Intranet login page
    > that authenticates domain users to AD on a Win2003 server. Is it possible
    > to code an .aspx page that will "automatically obtain the login user's
    > creditentials" (User ID and/or P/W) they provided to AD when the user
    logged
    > into their workstation? When I say "automatically obtain the
    creditentials"
    > I mean the user does NOT enter any info on the page. The code behind page
    > some how obtains that info via classes or objects or the Dotnet Framework.
    > I'd like to use that info to re-verify the account that is still active in
    > AD via an LDAP lookup. If it is still valid, then allow the user into
    > various Intranet websites, thus providing an "Automatic or Seamless" login
    > for the users.
    >
    > Is something like this possible to do? I thought I read somewhere that it
    > was possible with ASP Dotnet and not in classic ASP. Please let me know
    if
    > that is true and a basic plan on how could make it happen.
    >
    > Any suggestions would be appreciated. Thanks,
    > -Joe
    >
    >

    Chris Rolon Guest

  3. #3

    Default Re: Seamless Login Page with ASP Dotnet

    Chris,

    Excellent info! Just the kind of help I was hoping for! I greatly
    appreciate your time helping me with this. I will give it shot next week
    and see how it goes.

    Much obliged,
    -Joe


    "Chris Rolon" <chris.rolonremovethis.neudesic.com> wrote in message
    news:esmlrxVBFHA.3592TK2MSFTNGP09.phx.gbl...
    > In order to get the credentials of the user you will have to setup IIS for
    > your site as follows:
    > 1. Disable anonymous access to you site in IIS.
    > 2. Enable Windows Integrated Authentication.
    >
    > In ASP .Net you will need to add the following to web.config:
    > <identity impersonate="true" />
    >
    > In your code you do the following:
    > WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
    >
    > This will create a WindowsPrincipal with the user that is currently logged
    > into the domain. If you allow anonymous access or do not impersonate, the
    > WindowsPrincipal will be for the account used by ASP .Net. That will
    either
    > be ASPNET or NETWORK SERVICE.
    >
    > Chris Rolon
    >
    >
    > "Joe Rigley" <jcrigleyspartanmotors.com> wrote in message
    > news:Owx6nTUBFHA.2640TK2MSFTNGP14.phx.gbl...
    > > Hi,
    > >
    > > I'm a little new to ASP Dotnet, but have been coding in classic ASP for
    > over
    > > 5 years...
    > >
    > > I'd appreciate some suggestions/guidance in writing an Intranet login
    page
    > > that authenticates domain users to AD on a Win2003 server. Is it
    possible
    > > to code an .aspx page that will "automatically obtain the login user's
    > > creditentials" (User ID and/or P/W) they provided to AD when the user
    > logged
    > > into their workstation? When I say "automatically obtain the
    > creditentials"
    > > I mean the user does NOT enter any info on the page. The code behind
    page
    > > some how obtains that info via classes or objects or the Dotnet
    Framework.
    > > I'd like to use that info to re-verify the account that is still active
    in
    > > AD via an LDAP lookup. If it is still valid, then allow the user into
    > > various Intranet websites, thus providing an "Automatic or Seamless"
    login
    > > for the users.
    > >
    > > Is something like this possible to do? I thought I read somewhere that
    it
    > > was possible with ASP Dotnet and not in classic ASP. Please let me know
    > if
    > > that is true and a basic plan on how could make it happen.
    > >
    > > Any suggestions would be appreciated. Thanks,
    > > -Joe
    > >
    > >
    >
    >

    Joe Rigley Guest

Similar Threads

  1. Replies: 7
    Last Post: February 22nd, 05:29 PM
  2. Replies: 4
    Last Post: September 18th, 11:58 PM
  3. user and admin login on same login page
    By davellaman in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: May 16th, 07:47 PM
  4. making a login page which shud lead to a https page ?
    By sneha shetty via .NET 247 in forum ASP.NET Security
    Replies: 0
    Last Post: May 15th, 11:56 AM
  5. Creating News page the dotnet way
    By Nico in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: January 23rd, 05:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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