1



In my old asmx web services I used to have AuthHeader which contains the UserName & password and the AuthHeader is mandatory for every web method request. User will send his username & password using this AuthHeader and I will validate the request with the Username & password.

How can I ahieve the samething with WCF as webservice hosting in IIS with basicHttpBinding binding? Is there any way to make user mandatory to send AuthHeader with username & password?

,
nRk

2 Answers 2

1

You can uSe below code to pass username and password:

proxy.ClientCredentials.UserName.UserName = "testuser";
proxy.ClientCredentials.UserName.Password = "Password10";

And you need to set the security mode as transport.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks lucene, but when i am using basicHttpBinding, how can I make security mode to transport?
0

Please see if below link helps you out:

Use Username Authentication with Transport Security in WCF

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.