none
How to pass out side user and domain user credential to WCF service RRS feed

  • Question

  • i want to design a wcf service which will be accessed by our domain user and out side user. my service will have validate method and it will validate user against domain and database based on user type.

    service will accept user id & password whoever consume the service and validate method will just have the logic to detect the user is from our domain if yes then it will validate user against the domain and if the user from our side then it will validate user credential against database.

    1) just tell me how to pass domain user credential to service and also how out side user will pass their credential when they consume the service.

    2) specially help me to write isValid() function which can detect the user type. how to detect user type like user can be from our domain and user can be from our side.

    3) how to validate domain user.

    4) is it mandatory that my service has to have two different binding one for domain user and one for out side user because my service will consumed and called by our domain user and out side user like the below way.

    <bindings>
      <netTcpBinding>
        <binding name="SecureService_Tcp"
          …
          <security mode="Transport">
            <transport clientCredentialType="Windows"
                       protectionLevel="EncryptAndSign" />
            <message clientCredentialType="Windows" />
          </security>
        </binding>
      </netTcpBinding>
      <wsHttpBinding>
        <binding name="SecureService_WsHttp"
            <security mode="TransportWithMessageCredential" >
               <message clientCredentialType="UserName" />
            </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    Tuesday, April 1, 2014 2:16 PM

Answers