tags:

views:

55

answers:

3

Hello Friends

I send UserName & Password(Login Form) Form Client in the proxy to the server by this coding

myProxy.ClientCredentials.UserName="UserName";
myProxy.ClientCredentials.Pasword="Password";

In addition Our ClientCredentialType Must be MessageCredentialType.UserName.

in the server I need UserName & Password For Impersonate User to Make Log in the SQLSERVER with the same User that send Request to Server. So For this I need to get Sending Password in the Server And I don't Know How Must I do it? for get UserName I Use this Code ServiceSecurityContex.Current.PrimeryIdentity.Name

A: 

The password authenticates the user to the proxy; the proxy won't pass this information on. You'd need to explicitly pass the password to the service via the proxy to have this information available.

David M
no no - he's really sending the credentials to the service - from his WCF client **proxy** - that's the proxy he's talking about - not a proxy along the way from his client to the service.
marc_s
+1  A: 

You can take a look here: Delegation and Impersonation with WCF with special attention to delegation section.

Rubens Farias
A: 

How Can I do It?

sanaz_p