Saturday, November 14, 2009

Error "The username is not provided. Specify username in ClientCredentials."

Issue:
Error "The username is not provided. Specify username in ClientCredentials." while calling secured web service "HTTPS".

Cause:
Actually there're three causes with my application:
  1. Security mode was not appropriae.
  2. Client credential type was not appropriate.
  3. The call missed passing the required Username and Passwoed.

Solution:

The solution was in setting the apporpiate security mode, client credentials type and passing the required username and password.

  1. Set the appropriate Security mode in the configuration file (app.config OR web.config),it's should be "Transport":
security mode="Transport"


  1. Set the appropriate client credential type in the configuration file (app.config OR web.config),it's should be "Basic":

transport clientcredentialtype="Basic"

  1. Pass the required username and password:

proxy.ClientCredentials.UserName.UserName = "xyz";
proxy.ClientCredentials.UserName.Password = "123";

Ahmed A.Moneim

8 comments:

  1. This theme is simply matchless :), it is very interesting to me)))

    ReplyDelete
  2. Your blog keeps getting better and better! Your older articles are not as good as newer ones you have a lot more creativity and originality now keep it up!

    ReplyDelete
  3. I wish not acquiesce in on it. I regard as precise post. Specially the title attracted me to be familiar with the unscathed story.

    ReplyDelete
  4. There are various types of term life insurance rates, they all have some common attributes. You pay an insurance company what are called premiums. At your death, the life insurance company pays an amount to the people you named in your policy, called beneficiaries. Also it's interesting that if you named a beneficiary(ies) they'd receive the insurance amount free of income tax.

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Am getting the error mentioned here and i was trying out this solution but i can't figure out where this 'proxy' comes from, am using vs2010, wcf please help

    ReplyDelete
  7. My Client object generated by aading service reference doesn't have property to set ClientCredentials. then How can I set it?

    -patel

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete