RE: Impersonation, Delegation & SQL Server

From: Wei-Dong Xu [MSFT] (v-wdxu_at_online.microsoft.com)
Date: 11/21/03

  • Next message: Andrew: "Re: SSL & Certificates or Windows Auth"
    Date: Fri, 21 Nov 2003 01:52:37 GMT
    
    

    Hi Rob,

    Thank you for posting in MSDN managed newsgroup!

    After setting windows integrated authentication method in IIS and specify the impersonation to true for asp.net application, your asp.net
    application will run under the account which has been authenticated by IIS. For example, if you use "UserA" to login in the asp.net application and
    succeed, your asp.net application will run with the security of UserA account. Then when you access SQL server database, asp.net applicaiotn will
    try to use UsrA account to login into SQL server. If you haven't grant enought permission to this acount, your access will fail.

    In this way, if you only set <identity impersonate="true"> for your asp.net application, you should also set the permissions for all the users of the
    asp.net application in SQL server with appropriate permissions. I'd suggest you may build one account group and add all the users into that group.
    In this way, you will only need to set one account in the SQL server for this account group. If not, you will have to set each user in SQL server
    which will be very complex for the system management.

    >From my experience on this issue, I strongly recommend you that you can use the SQL server authenticate mode in SQL server and create one
    account only for your asp.net users. Each user will access the database with the connection string. You will only need to focus on this account for
    the database access which will make the system maintenance very easy. Furthrmore, each logoned user will have their own security restriction in
    your IIS server for the resources and in the same time, they can all access database very smoothly. This will also make the deployment very
    simple.

    In addition, the connection string in the config is clear text by default. Microsoft has released one utitlity for you for this which can encrypt
    credentials and session state connection strings of config file. You can obtain it free of charge from Microsoft. With the help of this tool, you can
    specify a very complex password for the sql account, for example "6sG3v2R0p2". Then you can encrypt them in the config file or store them into
    the registry. There is one KB article for this utitility which will help you a lot in this scenario. Please go to:
    329290 HOW TO: Use the ASP.NET Utility to Encrypt Credentials and Session State
    http://support.microsoft.com/?id=329290

    Please feel free to let me know if you have any further questions.

    Does this answer your question? Thank you for using Microsoft NewsGroup!

    Wei-Dong Xu
    Microsoft Product Support Services
    Get Secure! - www.microsoft.com/security
    This posting is provided "AS IS" with no warranties, and confers no rights.


  • Next message: Andrew: "Re: SSL & Certificates or Windows Auth"

    Relevant Pages

    • RE: Sp_xp_cmdshell_proxy_account & SQL 2005
      ... I Iunderstand that you are unable to create the proxy account on SQL Server ... Microsoft Online Community Support ...
      (microsoft.public.sqlserver.security)
    • Re: Kerberos from XP to IIS hosting ASP.NET 2.0 Web Service help
      ... If your MS SQL Server is running under a custom /local/ account, ... not sure how Kerberos authentication is supposed to work. ... If SQL Server is running under a domain account, ... you are not authenticating to IIS as anonymous. ...
      (microsoft.public.inetserver.iis.security)
    • Re: logon failure
      ... MSSQLServer service after you change the username of administrator account. ... username for the SQL Server startup service account or the SQL Server Agent ... Microsoft SQL Server service account on the SQL Server host computer. ...
      (microsoft.public.windows.server.sbs)
    • Windows Authentication with IIS on separate machines
      ... -Web Application is using Basic Authentication set in IIS ... -Added user account TESTUSER and gave read access to ... in SQL server but doesn't work if user account was ... Windows account, ...
      (microsoft.public.sqlserver.security)
    • Re: Trusted sql connection failure
      ... Is the SQL Server located on a different machine to the IIS webserver? ... you probably need to run ASP.NET under a domain account (or find some ... it appears that you are running ASP.NET under a local account (either ...
      (microsoft.public.dotnet.framework.aspnet.security)