none
WCF Custom Behavior RRS feed

  • Question

  • Hi,

     

    Below question may be specify to BizTalk.  Apologies if I posted in the wrong one. 

     

    I have built a WCF custom behaviour to populate username and password in the soap header. 

    It’s working fine. 

    My question is, is there any Attribute to mask the password property in .NET?  i.e when we define property in the Message Header/Behaviour class?

    At the moment it’s plain text. 

    Wednesday, May 1, 2013 5:40 PM

Answers

All replies

  • Hi,

    If you mean authenticate the service with username/password with a customUserNamePasswordValidator, there is not an "Attribute" in a popup window used to specify username/password from my experience.

    You need specify the username/password explicitly for the client like c.ClientCredentials.UserName.UserName = "fayaz"; c.ClientCredentials.UserName.Password = "soomro",  and you can store the custom username/password credentials in database. It supports ASP.NET membership provider based database or completely custom username/password validation code logic (via custom username password validator). I would suggest you check a reply by Steven in this thread for more information.

    Also check:WCF Service with custom username password authentication

    http://www.codeproject.com/Articles/96028/WCF-Service-with-custom-username-password-authenti

    Hope these information can help you.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, May 2, 2013 9:38 AM
    Moderator
  • Ok got it.  I have added [PasswordPropertyText(true)] attribute for Password property it's working fine.

    thanks

    Thursday, May 2, 2013 10:04 AM
  • I didn't mean customusername validator anyway I have solved it thanks haixia. 
    Thursday, May 2, 2013 10:06 AM
  • Hi,

    Glad to hear that the issue was resolved and thanks for your feedback.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, May 3, 2013 1:22 AM
    Moderator
  • Hi Trivier,

    You have mentioned this: I have built a WCF custom behaviour to populate username and password in the soap header. It’s working fine

    So could u help me how u have done this.

    how u have built the custon behavior for username and password?

    • Proposed as answer by renu relan Thursday, March 6, 2014 9:32 AM
    Thursday, March 6, 2014 9:27 AM