The ClaimsIdentityManager registers as an ApplicationService in SL. Once registered, it can encapsulate the process of requesting a token for a relying party, caching that token as well as setting the SOAP security header for outgoing service requests.
ClaimsIdentitySessionManager gets registered in app.xaml. Here you can specify the endpoint address of the WS-Trust token services as well as the credential type. In this sample I am using the ADFS2 Windows/Transport endpoint from my last post.
Calling the Service
All the service interaction is abstracted by the ClaimsIdentitySessionManager. The call to InvokeAsync does a few things:
- checks if a token has already been obtained for the service endpoint
- if not, requests the token and caches it
- if a password is required, invokes a callback to the UI
- sets the SOAP security header using the requested token
private void CallService()
var factory = new ChannelFactory<StarterServiceContract>(“symmetric”);
var proxy = factory.CreateChannel();
var channel = proxy as IClientChannel;
proxy.BeginGetClaims(result => ShowClaims(proxy, result), null);