score:0
Accepted answer
I've actually managed to get this to work by getting rid of the impersonation API code and adding the following to my web.config:
<location path="Services/MyServiceThatNeedsHigherPermissions.svc">
<system.web>
<identity impersonate="true" userName="domain\MyAccountWithElevatedPermissions" password="******"/>
</system.web>
</location>
The service runs under the context of my dedicated system account and connects to SQL using the same context.
score:2
Change LOGON32_LOGON_NETWORK
to LOGON32_LOGON_NETWORK_CLEARTEXT
in your call to LogonUser
.
This caches the logon credentials in the local security provider, which should enable a successful SSPI handshake with SQL Server.
More questions
- Impersonation failing for database connection
- Prompt for Database Connection String
- Impersonation succeeds but database connection fails
- SQL database permissions required to use impersonation from SSRS connection
- Connection string for SQL Server ( local database )
- Visual Studio - Connection String for SQL Server Database Project
- Can a Database project use a machine.config connection string for deployment?
- SQL connection string for database on network
- Does for loop open and close a database connection on each iteration?
- How do I use a different database connection for package configuration?
- Powershell Script for creating a local *.bak backup of a SQL Server database on a server via a remote Powershell connection
- Testing for network connectivity via opening a database connection
- Database connection works for Cassini, but fails for IIS
- SQL Server connection to a local database is failing all of a sudden. Nothing in code changed
- cshtml file and database connection pool for MS SQL Server
- How to specify a specific connection (or the database name) for Yajra Datatables in Laravel 5
- Database connection is closed in spring boot app when connecting to Azure MSSQL DB if we kept idle for sometime
- MS SQL database as a service connection string for C#, MVC Entity Framework application
- Best way to setup the database connection for my ASP.NET app?
- JBoss AS 5 database connection pool re-connect routine for MS SQL Server
- Dynamic connection string for entity framework code first for multiple database providers at runtime EF6 ( mssql, mysql, oracle )
- what is the connection string for this database
- How to fetch the row count for all tables in a SQL SERVER database
- Storing JSON in database vs. having a new column for each key
- What resources exist for Database performance-tuning?
- Cannot open database "test" requested by the login. The login failed. Login failed for user 'xyz\ASPNET'
- How do I search an SQL Server database for a string?
- How to use a variable for the database name in T-SQL?
- How do you check what version of SQL Server for a database using TSQL?
- "The transaction log for database is full due to 'LOG_BACKUP'" in a shared host
More questions with similar tag
- Problem with regional characters (polish) in php application and ms sql server
- Repeat data issues SQL
- Unsure of WITH CHECK clause when adding a constraint
- Is there any way I can make this condition work?
- Why can't I use filter my WHERE clause on a CASE statement column in SQL Server?
- How to trace log file size evolution in SQL Server?
- Why have I got an increased row count after LEFT JOIN
- Query for column value as column alias of a survey result
- How to migrate datetime to datetime2 with new SQL Server Native Client
- Take and Skip in SQL Server and EF
- Msg 242: conversion of a varchar data type to a datetime data type resulted in an out-of-range value
- Restore database in amazon web services RDS in SQL Server
- Slow SQL transaction blocks table
- Trigger on a specific date SQL Server 2014
- Implement SQL Server on Azure Virtual Machine Scale Set (VMSS)
- SQL Server connection remains open, even after closing
- How to handle archiving for seasonal database values on SQL Server
- Error with select in Stored Procedure SQL Server
- Schedule a SQL-query to move data from one table to another with Azure SQL-db
- How to select value A or both A and B but not B in a column?
- How can I merge overlapping times within a window?
- How send mail from SQL Server after fulfilling a date condition
- Cannot insert the value NULL into column 'EmpId'
- SQL Server sub query
- Is SQL Server's Full Text Search the right tool for searching phrases, not documents?
- In SQL can I return a tables with a varying number of columns
- How to get values from two table with subqueries?
- 'System.Guid' failed because the materialized value is null. Either the result type's generic parameter or the query must use a nullable type
- DATEDIFF and Leap Years for datetimeoffset fields in T-SQL
- T-SQL Query Problem
Source:
stackoverflow.com