windows authentication and mssql server

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

  1. #1

    Default windows authentication and mssql server

    Hi,

    I've got this asp project, Authentication mode is set to Windows and the
    identity impersonate is enabled.
    Is there any way to find out what user is logged in? I was thinking about
    something like the User.Identity object. But when i check the User.Identity,
    it is logged-in as an annonymous user (spelling?)

    The main thing I want to do with my project is the following:
    a user opens the page and authenticates with his windows password, then he
    is shown all his projects. That is, the projects he is allowed to see. All
    the data of the projects are stored in an mssql database.We connect to the
    database with a connectionstring that states "Trusted_Connection=true".

    But somehow al the users see every project from the database.
    Any help is appreciated.


    best regards,
    Bart
    Tjoep Guest

  2. Similar Questions and Discussions

    1. Authentication on Windows NT Server w/IIS 5 or 6
      I changed the authentication files on my production server to add in some new session variables. I did this using Dreamweaver 8, using my personal...
    2. Hybrid sql server and asp.net windows authentication
      I have an asp.net web application that executes stored procedures on SQL Server 2000 on the backend and displays the results of this stored procs on...
    3. connecting to sql server with windows authentication
      I'm confounded how difficult it is to setup a connection from an ASP.NET application to SQL Server on a different machine in the same windows domain...
    4. ASP.NET (IIS 6.0) Windows authentication/SQL Server problem
      Hi, On Windows 2000, I use the following connection string in my ASP.NET applications: <add key="ConnectionString"...
    5. ASP.NET + SQL Server Windows authentication
      Hey All, Trying to understand why I can not get SQL server to trust my IIS server. I have two machines set up, 1 App and 1 DB, and I'm trying to...
  3. #2

    Default Re: windows authentication and mssql server

    On Wed, 20 Apr 2005 07:09:01 -0700, "Tjoep" <Tjoep@discussions.microsoft.com> wrote:

    ¤ Hi,
    ¤
    ¤ I've got this asp project, Authentication mode is set to Windows and the
    ¤ identity impersonate is enabled.
    ¤ Is there any way to find out what user is logged in? I was thinking about
    ¤ something like the User.Identity object. But when i check the User.Identity,
    ¤ it is logged-in as an annonymous user (spelling?)
    ¤
    ¤ The main thing I want to do with my project is the following:
    ¤ a user opens the page and authenticates with his windows password, then he
    ¤ is shown all his projects. That is, the projects he is allowed to see. All
    ¤ the data of the projects are stored in an mssql database.We connect to the
    ¤ database with a connectionstring that states "Trusted_Connection=true".
    ¤
    ¤ But somehow al the users see every project from the database.
    ¤ Any help is appreciated.

    Did you configure the web application (in IIS) for either Basic or Integrated Windows
    authentication?


    Paul
    ~~~~
    Microsoft MVP (Visual Basic)
    Paul Clement Guest

  4. #3

    Default Re: windows authentication and mssql server

    Hello Tjoep,

    grab a copy of ShowContexts.aspx [1] - this exactly shows you under which
    identities your app is running - you know there are three ones in ASP.NET
    you have to deal with -

    Process Identity
    Thread Identity
    Context.User


    [1] [url]http://www.pluralsight.com/toolcontent/show_contexts.zip[/url]
    ---------------------------------------
    Dominick Baier - DevelopMentor
    [url]http://www.leastprivilege.com[/url]
    > Hi,
    >
    > I've got this asp project, Authentication mode is set to Windows and
    > the
    > identity impersonate is enabled.
    > Is there any way to find out what user is logged in? I was thinking
    > about
    > something like the User.Identity object. But when i check the
    > User.Identity,
    > it is logged-in as an annonymous user (spelling?)
    > The main thing I want to do with my project is the following:
    > a user opens the page and authenticates with his windows password,
    > then he
    > is shown all his projects. That is, the projects he is allowed to see.
    > All
    > the data of the projects are stored in an mssql database.We connect to
    > the
    > database with a connectionstring that states
    > "Trusted_Connection=true".
    > But somehow al the users see every project from the database. Any help
    > is appreciated.
    >
    > best regards,
    > Bart


    Dominick Baier [DevelopMentor] Guest

  5. #4

    Default Re: windows authentication and mssql server

    If you have Anonymous enabled in IIS and impersonation enabled in the
    config file, WindowsIdentity.GetCurrent().Name will return
    IUSR_<machinename> and User.Identity.Name will be an empty string.

    What you want is to get both User.Identity.Name and
    WindowsIdentity.GetCurrent().Name returning the currently logged on
    user. To do this, you need to disable Anonymous in IIS (and only enable
    Windows Integrated) and enable impersonation in the config file.

    HTH.

    swat Guest

  6. #5

    Default Re: windows authentication and mssql server

    Hi all,

    I found my mistake, the anonymous acces was indead enabled.
    Thanks for all your quick responses. seems to me, I can now succesfully read
    the identity.

    Bart
    Tjoep 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