Using the Workflow listener service with ADFS authentication is quite straight forward, if we use the Basic Authenticator. The service WFListener.asmx is not a WCF service, therefore we can't use federation security on it. Instead we need to use Basic authentication and handle the ADFS behind the scene. The Basic Authenticator module exposes a Basic authentication scheme, while communicating with the ADFS server in the background. Once a user is successfully authenticated, it creates a Thread and HttpContext security contexts, so that the following modules in the .NET request processing pipeline execute in the new security context.
As such, our client can define a Basic auth security using HTTPS transport and it will be able to connect to the service.
The code below is provided as an example only. The real client would be the Microsoft Visio plugin, which talks to the CM server by means of this service.
As such, our client can define a Basic auth security using HTTPS transport and it will be able to connect to the service.
App.config
The .NET Console application I use as test client uses generated service proxy classes. The configuration presented below defines the endpoint to connect to and a simple HTTPS Basic auth transport.<system.serviceModel> <bindings> <basicHttpBinding> <binding name="WFListenerSoap"> <security mode="Transport"> <transport clientCredentialType="Basic"/> </security> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="https://web85.playground/WFListener/WFListener.asmx" binding="basicHttpBinding" bindingConfiguration="WFListenerSoap" contract="WFListenerService.WFListenerSoap" name="WFListenerSoap" /> </client> </system.serviceModel>
Client Code
The client code creates a WFListenerSoapClient which uses the endpoint defined in the .config file.The code below is provided as an example only. The real client would be the Microsoft Visio plugin, which talks to the CM server by means of this service.
public Example1() { using (var service = new WFListenerSoapClient("WFListenerSoap")) { service.ClientCredentials.UserName.UserName = username; service.ClientCredentials.UserName.Password = password; Console.WriteLine("GetList: {0}", service.GetList()); } }
Comments