• Upgrade your Internet Experience
  • Sign in
  • Microsoft.com
  • United States (English)
    Brasil (Português)Česká republika (Čeština)Deutschland (Deutsch)España (Español)France (Français)Italia (Italiano)Россия (Русский)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語)香港特别行政區 (中文)
 
 
.NET Framework Developer Center
 
 
Home
 
 
Library
 
 
Learn
 
 
Downloads
 
 
Support
 
 
Community
 
 
Forums
 
 
 
.NET Framework Developer Center > .NET Development Forums > Windows Communication Foundation > Simple Security Question
Ask a questionAsk a question
Search Forums:
  • Search Windows Communication Foundation Forum Search Windows Communication Foundation Forum
  • Search All .NET Development Forums Search All .NET Development Forums
  • Search All MSDN Forums Search All MSDN Forums
 

AnswerSimple Security Question

  • Wednesday, August 13, 2008 7:58 PMomatase Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    I have a service that I have designed for message security. The current working production version uses an X509 to accomplish this. Using WCF this was a relatively simple feat.

    At the time when we first deployed this service there was only one user and a set of operations that were built for that user. Now we are expanding the service to multiple users. The new user should not have access to the methods the previous user had access to. Because of this new requirement, using X509 to simply secure the message is not enough security anymore.

    Now I need to implement a UN/PW system so that I can provide role-based access to the different operations available. I have been pounding the pavement on this for several hours and *thought* I had it, but I can't get passed a very generic and vague error message: " System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. --->  System.ServiceModel.FaultException: An error occurred when verifying security for the message.."

    My intention is to use the default ASP.Net membership provider to authenticate people. I have the following binding definition now:

    Code Snippet

    <bindings>

    <wsHttpBinding>
    <binding name="UserNameWS">
    <security mode="Message">
    <message clientCredentialType="UserName" />
    </security>
    </binding>
    </wsHttpBinding>
    </bindings>


    I simply changed the line "clientCredentialType="None"" to clientCredentialType="UserName". I also worked to configure the ASP.Net membership provider.
    My assumption (and that's all it is at this point) is that since I have that membership provider as my default and I have the clientCredentialType set to UserName that WCF will use the membership provider to authenticate the user upon receipt of a new message. I don't know if that assumption is right or if more configuration needs to be done first or if what I want is even possible. I can't find anything online that will tell me I can do it this way exactly.
    In the interest of being complete, here is how I am providing the client credentials on the client side.
    Code Snippet

    service.ClientCredentials.UserName.UserName = "user";
    service.ClientCredentials.UserName.Password = "password";

    • ReplyReply
    • QuoteQuote
     

Answers

  • Monday, August 18, 2008 2:43 PMomatase Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Vote As Helpful
    0
    Thanks for your help, I found the problem and it was a dumb one. I was using integrated security on the connection string for the database so the problem simply was it couldn't connect to the db to authenticate my credentials. I changed this and it is all working now.

    Thanks again!
    • ReplyReply
    • QuoteQuote
     

All Replies

  • Thursday, August 14, 2008 2:25 PMomatase Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    bump
    • ReplyReply
    • QuoteQuote
     
  • Thursday, August 14, 2008 3:35 PMDan RigsbyMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

    Are you using a certificate or SSL?  This errro indicates taht you should be using one of these to protect the data.

    • ReplyReply
    • QuoteQuote
     
  • Monday, August 18, 2008 2:52 PMDan RigsbyMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    Glad it was something simple and that you could find it on your own!  This would have been difficult to diagnose over teh forums. 

     

    • ReplyReply
    • QuoteQuote
     
  • Wednesday, May 06, 2009 7:53 AMvertho Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    I have the same problem now, but I dont understand what you meen by "i changed this"?
    What exactly did you change to get this working?
    • ReplyReply
    • QuoteQuote
     
  • Wednesday, May 06, 2009 7:53 AMvertho Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    Hi Dan, do you know what he changed to get this working?
    • ReplyReply
    • QuoteQuote
     
  • Wednesday, May 06, 2009 8:36 AMRichard BlewettModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    Vote As Helpful
    0

    The OP was using integrated security on his connection string. The account that the service was running as didn;t have access to the database. "I changed this" means he either granted access to the database for the account or he changed to use SQL logins (providing a userid and password in the connection string)


    Richard Blewett, thinktecture - http://www.dotnetconsult.co.uk/weblog2
    Twitter: richardblewett
    • Proposed As Answer byRichard BlewettModeratorWednesday, May 06, 2009 11:28 AM
    •  
    • ReplyReply
    • QuoteQuote
     
  • Wednesday, May 06, 2009 10:33 AMvertho Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    ah! Thank you Richard
    • ReplyReply
    • QuoteQuote
     
Need Help with Forums? (FAQ)
 
© 2009 Microsoft Corporation. All rights reserved.
Terms of Use
|
Trademarks
|
Privacy Statement