Running a published aspnet core app with windows auth and Trusted_Connection connectionString
See original GitHub issueHi there,
What is the best practice for configuring an enterprise asp.net core app which uses windows active directory auth - specifically in relation to DB connectionStrings? What I was hoping for is to use Trusted_Connection (e.g. Server=XXX;Database=YYY;Trusted_Connection=true;
) and to configure IIS / dotnet to run the core app using windows user impersonation (or whatever it’s called) so that the core app would issue DB queries using the credentials of the user who is browsing the web app.
The core process appears to inherit the user credentials of the IIS website user (as configured in IISM > app pool & site) - which in fairness is in keeping with how IIS apps used to run. So Trusted_Connection doesn’t work for application user (pass through auth) so I either have to make the IIS site run as a specific windows user or use sql user auth in the connection string (e.g. Server=XXX;Database=YYY;User ID=myUsername;Password=myPassword;
)
Is there a way to do Trusted_Connection as the user browsing the website?
Issue Analytics
- State:
- Created 7 years ago
- Comments:46 (12 by maintainers)
@DickvdBrink I updated the demo app here: https://github.com/ilanc/AspNetImpersonate
I’m missing the exact steps to enable double-hop/impersonation on the domain. If I hear back from IT I’ll post them here. I include a bunch of links in the readme at the above repo.
How about MSFT starts ditching MVC examples, and focuses on REST based ones w/ LDAP/WinADGroups/WinAuth + JWTs: Where front end is 100% decoupled from backend. I mean, its better design for scalability and security purposes. MVC is old and outdated - take heed that aint nobody got time fo’ dat! #Rx #Reactive #Ng #FullyDecoupledUI