WCF Claims, STS and Federation – Layman’s View – 2

| Comments

In the previous post, we have seen the service configuration of WCF federation.  In this post, let us see the STS configuration. 

In the STS’s configuration file, it is mentioned in element. 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 

<system.serviceModel>
  <services>
   <service name="Udooz.SecurityTokenService" behaviorConfiguration="stsBehavior">
    <endpoint contract="Udooz.ISecurityTokenService" binding="wsHttpBinding" bindingConfiguration="stsBinding"/>
   </service>
  </services> 

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

The STS service contract is declared in Udooz.ISecurityTokenService and implementation is resided in Udooz.SecurityTokenService. 

 

 

The message security mode is specified in .....  

This is specified in the section named “stsBehavior”. 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
 

<behaviors>
   <serviceBehaviors>
    <behavior name="stsBehavior">           
     <serviceCredentials>
                 <userNameAuthentication
              userNamePasswordValidationMode="Custom"
              customUserNamePasswordValidatorType="UdoozCommonLib.STSUsernamePasswordValidator, UdoozCommonLib"/>
            <serviceCertificate findValue="WCFServerKey" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="My" />           
     </serviceCredentials>
    </behavior>
   </serviceBehaviors>
  </behaviors 

The username-password authentication is done by UdoozCommonLib.STSUsernamePasswordValidator class in UdoozCommonLib assembly. 

To be continued…