Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WIF (Windows Identity Foundation) with SAML 2.0

First some background:

We were recently tasked to send a SAML 2.0 assertion to the server that we are communicating with. We are using WCF for our client. The server is not using WCF. The guys who implement the server, don't have an STS that will issue a SAML assertion. We are trying to use WIF framework because it supports SAML 2.0 tokens.

  1. Is it possible to send a SAML 2.0 assertion with the message from the client without getting the SAML2 token from an STS? If it is can someone please post some sample code on how to do this with WCF and Windows Identity Foundation? I looked around and could not find anything.

  2. Does anyone have any examples with a client getting a SAML2.0 token from an STS and then sending that token with an assertion to a server app?

like image 987
Vadim Rybak Avatar asked Feb 12 '10 16:02

Vadim Rybak


People also ask

What is WIF authentication?

Windows Identity Foundation (WIF) is a rich identity model framework designed for building claims-based applications and services and for supporting active and passive federated security scenarios.

What does Windows Identity Foundation 3.5 do?

It provides a set of ASP.NET controls that help developers create web pages in claims-aware applications. It includes a utility that helps developers translate between claims and NT tokens, so that claims-aware applications can be used to access resources that require NT-Token based identity.

What is Windows Identity Foundation Windows 10?

Windows Identity Foundation (WIF) is a new extension to the Microsoft . NET Framework that makes it easy for developers to enable advanced identity capabilities in the . NET Framework applications.

Does WIF support SAML-P?

Basically this is to SAML-P what WS-Trust is to WS-Federation. WIF does not support SAML-P, although some time ago an extension to WIF that adds SAML 2.0 support was CTP’ed but has not took off since then. Here you can see the announcement:

Does ADFS 2 support SAML 2 confirmation tokens?

After working to get ADFS 2.0 working with SAML tokens, it appears as though there is a rarely documented inadequacy with ADFS in terms of the confirmation type of the SAML 2 tokens that can be issued. AFAIK, only BEARER type tokens are supported, which limits the scope of ADFS 2 in scenarios where Sender-Vouches or Holder-of-Key is required.

What are the stages of identity and access support in WCF?

As was discussed in the previous section, we have seen how identity and access support in .NET passed through multiple stages, from the simple IsInRole checking, to claims support in WCF 3.0, to WIF 1.0 and then to .NET 4.5. WIF 4.5 is where this ends (and the new work begins!).

How do I create a SAML token for local development?

In the Local Development STS tab, you should set the token format to SAML 2.0; you may leave the port number as is. In the area entitled, "Test claims to issue:" you will see a collection of claims that will be added to the token. You may edit the values, delete them, or add new ones to this claims collection.


2 Answers

You could try having a look at thinktecture starter STS. It comes with source code so you could pick out the bits that create the SAML token.

And from this answer you do not need a STS.

like image 159
Shiraz Bhaiji Avatar answered Oct 03 '22 12:10

Shiraz Bhaiji


I'm assuming you wanted to use standard WS-Security mechanism to attach a SAML token with the SOAP message? Your question is essentially a two part one:

  1. How to get token - you will probably create it yourself? See this link for how to do this. http://www.leastprivilege.com/UsingSAMLAsAClientCredentialTypeInWCFWithGeneva.aspx

  2. How to send the token to service as part of SOAP message? You can attach a SAML token with a WCF channel by using WSTrustChannelFactory class. http://msdn.microsoft.com/en-us/library/ee517268.aspx

hope that helps, Zulfiqar

like image 28
zamd Avatar answered Oct 03 '22 14:10

zamd