Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Can't Impersonate User Info thru ADO.Net

Can't Impersonate User Info thru ADO.Net

Scheduled Pinned Locked Moved ASP.NET
databasesecurityworkspacecsharp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    WetRivrRat
    wrote on last edited by
    #1

    Ok, so anyone ready for a good one??? Trying to run a vb.net webApp that connects to sql. I can NOT allow the domain username to be written in the web.config file so I must use impersonation (trusted_connection). Problem:

    Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection

    when trying to access remote SQL Server with

    <identity impersonation = "true" />

    -- I need to beable to connect/access the sql db by use of domain user accounts, but without having to manually enter the user credentials to access. IOW by use of Impersonation. Configuration: I've tried to configure IIS to both of these two possible options: A.) Anonymous Access is DISABLED and Integrated Windows Authentication is ENABLED B.) Anonymous Access is ENABLED and Integrated Windows Authentication is DISABLED with username defined as a valid domain account/password.(i'll explain this method later) I have defined my SQLConnectionString as:

    Data Source=ServerName01;Initial Catalog=StageDBid;Integrated Security=SSPI;

    I have also setup a block of code that would check the current impersonated user before executing the sqlConnection and am getting the [correct]expected User.Identity back. So I know that the Impersonation aspect is functioning, but for some reason it is not passing this info to the DB or the "Integrated Security=SSPI"("Trusted_Connection="yes" ") is not working. Requested Soultion: I need to beable to connect to SQL thru the webApp by use of the individual Users Domain Account UserNames.) Oh, yah I promised to explain my second method of connection to the db by use of the Anonymous Account.... I Can connect to the db if I use the method (B) listed above, with impersonation enabled and using a domain user account by disabling Integrated Windows Authentication and specifing the domain account.... problem is I'm still restricted to using a single account for connection to the db. I need to beable to connect/access the sql db by use of domain user accounts, but without having to manually enter the user credentials to access. IOW by use of Impersonation. string Beautiful; Beautiful = "ignorant"; label1.Text = "The world is full of " + Beautiful + " people."; Why is common sense such an un-common comodity?

    D 1 Reply Last reply
    0
    • W WetRivrRat

      Ok, so anyone ready for a good one??? Trying to run a vb.net webApp that connects to sql. I can NOT allow the domain username to be written in the web.config file so I must use impersonation (trusted_connection). Problem:

      Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection

      when trying to access remote SQL Server with

      <identity impersonation = "true" />

      -- I need to beable to connect/access the sql db by use of domain user accounts, but without having to manually enter the user credentials to access. IOW by use of Impersonation. Configuration: I've tried to configure IIS to both of these two possible options: A.) Anonymous Access is DISABLED and Integrated Windows Authentication is ENABLED B.) Anonymous Access is ENABLED and Integrated Windows Authentication is DISABLED with username defined as a valid domain account/password.(i'll explain this method later) I have defined my SQLConnectionString as:

      Data Source=ServerName01;Initial Catalog=StageDBid;Integrated Security=SSPI;

      I have also setup a block of code that would check the current impersonated user before executing the sqlConnection and am getting the [correct]expected User.Identity back. So I know that the Impersonation aspect is functioning, but for some reason it is not passing this info to the DB or the "Integrated Security=SSPI"("Trusted_Connection="yes" ") is not working. Requested Soultion: I need to beable to connect to SQL thru the webApp by use of the individual Users Domain Account UserNames.) Oh, yah I promised to explain my second method of connection to the db by use of the Anonymous Account.... I Can connect to the db if I use the method (B) listed above, with impersonation enabled and using a domain user account by disabling Integrated Windows Authentication and specifing the domain account.... problem is I'm still restricted to using a single account for connection to the db. I need to beable to connect/access the sql db by use of domain user accounts, but without having to manually enter the user credentials to access. IOW by use of Impersonation. string Beautiful; Beautiful = "ignorant"; label1.Text = "The world is full of " + Beautiful + " people."; Why is common sense such an un-common comodity?

      D Offline
      D Offline
      Dustin Metzgar
      wrote on last edited by
      #2

      For your option A, did you have digest authentication checked? I've used the exact same thing you're talking about with no problems getting to the database, but I had digest authentication on.


      Logifusion[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups