質問する質問する
 

回答済みSimple Security Question

  • 2008年8月13日 19:58omatase ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    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";

回答

  • 2008年8月18日 14:43omatase ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     回答済み
    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!

すべての返信