Share via


Task 1: Enable Role-based Authorization on the Workflow Service

Download sample

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

  1. 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.

  2. 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.

  3. In the Workflow1InitialState StateActivity activity, double-click the WaitToStartService EventDrivenActivity activity to expand it.

  4. Highlight the ReceiveActivity activity associated with the StartupService operation.

  5. In the Properties pane, under ServiceOperationInfo, click the ellipsis to open the Choose Operation dialog box.

  6. If the StartupService operation is not already highlighted, highlight it.

  7. Select the Permissions tab.

  8. 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.
    
  9. 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