Blankman
Blankman

Reputation: 267290

WCF security mode is TransportWithMessageCredential using UserName, where to validate?

Here is part of my web.config for my WCF service:

<bindings>
      <basicHttpBinding>
        <binding name="sslBinding">
          <security mode="TransportWithMessageCredential">
            <message clientCredentialType="UserName" algorithmSuite="Default" />
            <transport />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>

Where exactly do I check for the username when a client tries to consume my service? Is there some method I have to override to validate the username?

Upvotes: 3

Views: 7424

Answers (1)

Nicolas Dorier
Nicolas Dorier

Reputation: 7475

<behaviors>
        <serviceBehaviors>
          <behavior name="behavior">
            <serviceCredentials>
              <userNameAuthentication customUserNamePasswordValidatorType="myType, assembly" userNamePasswordValidationMode="Custom"/>
            </serviceCredentials>
          </behavior>
        </serviceBehaviors>

Upvotes: 6

Related Questions