Built-in protection in the connection string

I just tried to port my WCF service to Windows Authentication using this connection string

<add name="MembershipConnection" connectionString="Data Source=DBADDRESS ;Initial Catalog=aspNetMembership;Persist Security Info=True;Integrated Security=SSPI;"/>

The WCF Service is hosted in IIS (2003) and the user I set up under Directory Security is like the user we set up for this application, which has permission setting in SQL. The application pool configuration for this application is done under the "Network Service" user, but I am getting this exception when I try to use this service.

System.Data.SqlClient.SqlException: Login failed for user 'Domain \ MAchineName $'

I spoke to our sysadmin and he says that the $ at the end of the username means the computer itself if it is trying to authenticate a non-user.

any ideas as to why the machine is trying to authenticate and not a custom setting in IIS?

+2


source to share


2 answers


Actually, it works as advertised: the "Network Service" user will authenticate as a machine for any remote connections. From the msdn docs on it here :

Service that runs in context under the NetworkService account computer credentials of the remote servers



If you need a specific account, you need to create one and configure the application pool to run under that account.

If you want to authenticate as a user, you need to set up delegation.

+4


source


You need to configure the service to impersonate the caller (simple part like with [OperationBehavior(Impersonation = ImpersonationOption.Required)]

), then you need to configure IIS for constrained delegation. Cm



+1


source







All Articles