Eric's Blog

Day to day experience in .NET
Welcome to Blogs @ IRM Sign in | Join | Help
 Search

Disclaimer

The content of this site is my own personal opinion and does not in any way represent my employer, it's subsideries or affiliates. These postings are provided "AS IS" with no warranties, and confer no rights.

This Blog

WCF Security Token Service (STS)

Almost three years ago I started to think in the terms of having an infrastructure service to handle security like verifying users, getting which roles they belong to and so on. Back then it was WSE 3 in a beta and no information available on the Internet (that I could find anyway). I had heard of WS-Trust and I had also seen a sample on an event where a Swedish Microsoftie showed something that I think was a Security Token Service (I actually don't remember all the details). Well anyway after having big problems getting the pieces together with the certificates and everything I started to doubt that I was on the right direction. Fortunately I had the opportunity so sit down with Don Smith on the PDC 05 and also to get some hands on help from Siddharth in the WSE team to get my STS implementation running with correct signing and encryption (see my post PDC Day Five: Interacting with Microsoft employees). So back in September 2005 I finally had my service running with a custom xml token. Not long after that pattern & practices released their whitepaper on web service security and then also a Quickstart for implementing a STS with a SAML token. I converted my solution to be based on their code and extended it to fit my needs. Now I want to also WCF enable this service and maybe also take some new steps to improve some parts of it based on the experience that I've gathered during this time. Today there a lot more samples (even in the .NET 3.0 SDK) to get you started on the subject and for example you could read two excellent articles on theserverside.net written by Michéle Leroux Bustamente (http://www.theserverside.net/tt/articles/showarticle.tss?id=ClaimsBasedSecurityModel and http://www.theserverside.net/tt/articles/showarticle.tss?id=ClaimsBasedSecurityModel2).
It's not that difficult to create a working STS service from this samples that works great with wsFederationHttpBinding, but I have some other requirements that showed not be as easy to solve. This is a list of some of the requirements that I have:
  • I want to verify the users credentials immediately when he/she logs on. The wsFederationHttpBinding requires you to set the client credentials to be used against STS when calling the business service (relying party).
  • When the user logs on I will call Issue on the STS and get a SAML token back. When calling a business service I want to use this SMAL token for the wsFederationHttpBinding so that I won't be required to hang on to the clients username/password.
  • Extend the STS to support Cardspace (today it supports username/password and kerberos).
  • If the business service needs to call another business service, I want the SAML token to flow with it if the SAML token applies to that service too.
  • I want to be able to use information from the SAML token in the client to. For example if I have user roles in the SAML token, it would probably be useful to be able to set up a principal object on the client with this roles.
As I solve this problem (if I solve them), I also will blog about them because there are not so much information about it available. As I implement this I will try to do it so that the security will be as good as it is with the standard wsFederationHttpBinding (and that's better than what I have today based on the WSE Quickstart STS). I also have some other requirements like creating custom claims (SAML attributes) and I also want the STS to be very configurable so that I could easily extend the SAML token with more claims. I probably will not blog about this because there are great information available how to do this for example in the two articles referenced above. I would also be happy to hear from you dear reader if there are something that you find interesting in this area and I might try to solve that too and blog about it.
Published den 4 december 2007 14:41 by ericqu

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Nathan Bellamore said:

Can you please keep me updated with your findings - any help gratefully appreciated. Please email: nathan.bellamore@rbi.co.uk Sincerely, Nathan.
mars 10, 2008 15:43
 

Martin said:

Hi ericqu, I will also appreciate if you may update me with your findings. Please mail: spooks@gmx.net Best regards
juni 4, 2008 18:04
 

Mohammad ELFarsi said:

Could you upload the code for this the updates that you have done with it ?
augusti 11, 2008 13:11
 

ericqu said:

@Mohammed ELFarsi: I have posted individual post for each of the updates that I have done. Check out all posts tagged with Security Token Service ( http://blog.irm.se/blogs/eric/archive/tags/Security+Token+Service/default.aspx). Note that I have not had time to solve support for Cardspace.

augusti 13, 2008 09:51
 

rajesh said:

Hi Ericqu, I need a STS code sample that should work as below 1) The client sends rst message to STS using windows username (No certificates should be used) 2) The STS Service should send a Encrypted SAML token in RSTR 3) The client should generate a request to the relying party where in the requested message should contain the saml token 4) on the service side i use interceptor to validate the token and the process of authentication and authorisation. could you please let me know how can this be done or help me if you have any code of such type. Also, i don't want to use certificates as i need to support non-wcf clients.
oktober 14, 2008 23:30
 

ericqu said:

You will need to use certificates to be able to encrypt and sign the SAML token. The client does not need to use a certificate when using a Kerberos (windows) token to authenticate against the STS.

Most of what you describe is supported by the WsFederationBinding and a STS to start out from (with code) can be found in Michele's articles at theserverside.net site. You will need to change that to use kerberos tickets instead of username/password though. If you start a new project now, it could be very interesting to take a look at Zermatt.

oktober 15, 2008 18:16
 

Erics Blog said:

Geneva is the code name of Microsoft's identity framework (and it replaces Zermatt for those of you who

november 2, 2008 22:06

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server, by Telligent Systems