STS, SAML, and AppliesTo (design)

I have somehow managed to get an STS up and running. I now think WCF should have been called WTF. In any case it took me almost a full day and i still don't get all of it - but anyway i managed to have it such that when my webservice is requested and it specifies through wsFederationBinding that it is IssuedTokens and that my STS is contacted passing in UserName and Password (which at STS side is custom validated so it is not windows). The token type is SAML 1.1.

Anyway, this all works a treat (though is not like any sample i've come across except it is a bastardised form of all of them and then some) , my STS gets the WCF created magic token that represents i guess the UsernamePassword thing thats going on, and in return i bang out some extra claims on top of that by way of return. It is this token by way of return which then makes its way into my webservice wherein i can inspect my claims from my very own trusted STS.

Great stuff, it all works - somehow! :-)

Ok - but here is the niggle. There is this AppliesTo property which knows the url of the webservice being requested such that i guess this token "AppliesTo" only my webservice. Now that is pants. I wanted my token so that i could use it across my sites that trust the STS. It doesn't apply to just this service - this token applies to any of my services.

I imagine (though haven't yet checked) i can cache this same token on the client and use it in other calls to other services of mine which also trust the same STS, in fact - this is precisely what i intend to do, but still the niggle is that if this is a normal use case why on earth is my AppliesTo (if cached) listing the service which it was initially created in response to. It just doesn't seem right - it's uncalled for - and it's not nice. :-)

Surely there is some more repsentational form of the AppliesTo (and also if there is how do i hook into this as it seems this came across from some auto code in the client proxy) that is more proper. Something like AppliesTo="*". That more befits a proper token - after all - the token applies to anyone who can read it and its claims - which would be mighty hard to do if you didn't have the certificate.

I can imagine that knowing the AppliesTo might indicate the claims i might wish to make from my STS which are relevant to the service being called in some scenarios, so fair enough on that one, but how do i reply with a token that says this token Applies to everyone so deal with it service(s).

Anyone understand what the hell i am on about here?

Cheers

B

P.S WCF?, SAML?, STS? I've sh1t em!

[2678 byte] By [Bolox] at [2008-1-10]
# 1

I think you're partially confusing the AppliesTo in the RST with the SAML token's audience restriction condition. For example, the STS in the durable issued token provider sample doesn't propagate the AppliesTo to the token's audience uri. Further, you can override the default AppliesTo by specifying one in code or config on WS[2007]FederationHttpBinding.Security.Message.TokenRequestParameters or IssuedSecurityTokenParameters.AdditionalRequestParameters. (Disclaimer: I haven't actually done this, but it should work.)

ToddWest-MSFT at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 2

Sounds about right. Thanks for your help. I did note there was no adverse effect - just it seemed odd. I had a dig arond and couldn;t find anything about what the AppliesTo on the rst is for? Sure it has some endpoints in it - but as you point out - there is no mapping to an audience uri.

Cheers

Bolox at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 3

Hey Todd

So i added the audience restriction to my RSTR - and then its back to WCF to do its magic. Sure enough it calls into my webservice....but...when my webservice is called where on earth do i get the audience restriction from? the operationcontext in my custom ServiceAuthorizationManager derivative is presumably the only place it can live? further on from that statement it presumably can only live in the operationContext.ServiceSecurityContext? Nothing in there relates to this condition which can find.

Cheers

B

Bolox at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 4

In Orcas you can configure audience uri checking via ServiceHost.Credentials.IssuedTokenAuthentication.AudienceUriMode and AllowedAudienceUris. In .NET 3.0 you'd need to plug in a custom SamlSecurityTokenAuthenticator to check the uri. In either version, a custom SamlSecurityTokenAuthenticator which overrides ValidateTokenCore() is required if you want to yield an audience uri claim to the authorization context for a SAM to action.

It sounds like AppliesTo is of minimal interest in your scenario as your clients and STSes only support a very limited set of services within a single trust domain. In a less restricted federation the STS may need to apply different token issuance policies for different relying parties; a particularly common, if minimal case, is using the AppliesTo to look up the cert to use to encrypt the issued token.

ToddWest-MSFT at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 5
Thanks.
Bolox at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...

Visual Studio Orcas

Site Classified