Click here to Skip to main content
15,884,473 members
Articles / Programming Languages / XML

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

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
23 Dec 2010CC (ASA 2.5) 14.1K   2   1
In the previous post, we have seen the service configuration of WCF federation. In this post, let us see the STS configuration.

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

Image 1

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

XML
<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.

Image 2

Image 3

The message security mode is specified in <binding>..<wsHttpBinding>..<binding name=”stsBinding”>…<security>.

This is specified in the <serviceBehaviors> section named “stsBehavior”.

XML
<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…

This article was originally posted at http://udooz.net/blog/2010/12/wcf-sts-federation-claims-2

License

This article, along with any associated source code and files, is licensed under The Creative Commons Attribution-ShareAlike 2.5 License


Written By
Architect Aditi
India India
Working as Architect for Aditi, Chennai, India.

My Website: www.udooz.net

My Blog: www.udooz.net/blog

Comments and Discussions

 
QuestionNext (3rd) article? Pin
Chiragdbhavsar4-Jun-12 1:15
Chiragdbhavsar4-Jun-12 1:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.