Task 1: Enable Role-based Authorization on the Workflow Service
In this task, you ensure that only users of a certain NT account group are authorized to access to the workflow service operations you created in Exercise 1: Create a Basic Workflow Service.
Note
When the Visual Studio workflow designer is used to create or manage workflow services, it sometimes produces spurious validation errors. If you are able to successfully build your project, ignore the validation errors.
To enable role-based authorization with the PrincipalPermissionRole property
If you do not currently have the WorkflowServiceTutorial solution open, then open Visual Studio 2008, click File, highlight Open, and navigate to the WorkflowServiceTutorial solution.
If the workflow designer for the service is not visible, open the designer by right-clicking Workflow1.cs (or Workflow1.vb if you created a Visual Basic solution) and select View Designer.
In the Workflow1InitialState StateActivity activity, double-click the WaitToStartService EventDrivenActivity activity to expand it.
Highlight the ReceiveActivity activity associated with the StartupService operation.
In the Properties pane, under ServiceOperationInfo, click the ellipsis to open the Choose Operation dialog box.
If the StartupService operation is not already highlighted, highlight it.
Select the Permissions tab.
In the text box associated with Role, type in SampleUsers and click OK.
Now when you run your service, the client will have its credentials checked against the NT account group SampleUsers whenever the client invokes the StartupService operation. If the caller's credentials do not belong to the SampleUsers account group, then the service will send back the following message to the client:
Access denied.
Perform steps 3 through 8 for the remaining operations implemented by the workflow service.
See Also
Other Resources
Task 2: Enable Claim-based Authorization on the Workflow Service
Exercise 2: Implement Security Features on the Workflow Service
Copyright © 2007 by Microsoft Corporation. All rights reserved.
Last Published: 2010-03-04