Hi,
I am using the WorkFlowServiceHost(in .net 3.5) to host a State Machine Workflow. I use the WCF receive activities to handle calls into the workflow. I am using a WCF authorization policy to attach claims to the incoming requests based on info in the message headers. So, further down the chain I can use the ServiceSecurityContext or just the Thread.CurrentPrincipal to get authorization info about the request(roles, user, etc).
I know this will not work for us because the workflow is dispatching different threads to handle the events that the runtime engine raises when there is work to do(ie. the receiveactivity). The contextual info about the request(OperationContext) is no longer available within the workflow(except randomly when the work is executed on the runtime thread).
What I would like to do is get the info about the request(OperationContext) before the worker thread is created, get the worker thread and attach the contextual info to it so it is available within the workflow instance.
I am thinking there must be some event on the runtime I can handle to do this but I am not coming up with anything. And I really don't want to use the manual workflow scheduler. Any help is appreciated.
Thanks!