Connect to MSSQL as user from ASP Web App RRS feed

  • Question

  • User-1893600799 posted

    I have as ASP Web page with a DataGridView on it witch gets data from a MSSQL Server from a view.

    The view returns different data depending on the user who calls it so the connection must be made as the current user(AD accounts) who is logged into the ASP App.

    Login as the user is no problem and even SSO in Internet Explorer works but the connection to the database is done under the machine account of the server where the app is running instead of the user.

    Ive tired to configure ASP impersonation in IIS but this dosent seem to work and im not even sure if this is needed as SSO worked fine without it...

    Can anyone point out some examples of how IIS and the SQL connection string need to be configured for SSO in the App(optional) and user connection to SQL to work?

    Tuesday, March 14, 2017 1:35 PM

All replies

  • User-1265267694 posted
    Forgive my over simplification attempt, but couldn't you adjust your query to include the username as an argument? Unless you have a SP that queries the name made on its execution behalf, this would seem easier than managing lots of sql server users. At least manage all server at the role level vs users. However you may not have control over the interface.
    Tuesday, March 14, 2017 3:16 PM
  • User-1893600799 posted

    I have a SP that queries AD information of the calling identity and stores it in a session variable for that identity, so if all the connections run under the one machine identity then it dosent work

    User management is easy... simply setup a AD group with the needed permissions on the SQL Server and then just manage the group in AD

    Tuesday, March 14, 2017 3:34 PM