Search
Technology

BizTalk Integration with Windows Azure AppFabric Service Bus : Publishing Service Bus messages to BizTalk Server (part 3) - Building the Access Control Service Components

Published 3 min readBy Programming4us Editorial Team

3. Building the Access Control Service Components

The AC service can take claims provided by one party and translate them to claims needed by another party. For this part of the solution, we define a set of AC rules that govern permission to send messages to the BizTalk service endpoint.

  1. First, we need our credentials to manage our AC Security Token Service (STS), which is responsible for issuing valid tokens. Visit http://windows.azure.comManagement Key Name and Current Management Key for a previously-created service namespace. These values are needed to access and manage our STS. and record the

  2. Download and open the Azure platform AppFabric SDK (version 1.0 available at http://bit.ly/9kEVfh and navigate to the AcmBrowser application within the Access Control samples (AccessControl\ExploringFeatures\Management\AcmBrowser). Compile and run the AcmBrowser application.&;

  3. Within the AcmBrowser, enter valid AC credentials into the Service Namespace and Management Key and click the Load from Cloud button to confirm connectivity.

  4. Create a new Issuer that represents the WatsonBSafe company. Right-click the Issuers node and choose Create.

  5. Set the Display Name and Issuer Name to WatsonBSafe and generate keys.

  6. We need an additional Issuer for each vendor who is communicating with us. When vendors call our services, they use their unique issuer and we will map their Issuer claims to the claims understood by our application. Create another Issuer named Riley Semiconductor.

  7. Right-click on the Token Policies menu item to create a Token Policy, which is responsible for signing tokens and applying a designated token lifetime. The new Token Policy is named WatsonBSafe Token Policy and has a 3600 second timeout along with a generated Signing Key.

  8. With the Issuer and Token Policy in place, we define a Scope by right-clicking the Scopes menu item and creating a new scope. An AC Scope is a collection of rules that dictate token-issuing behavior for a designated resource. Set the scope's name, appliesTo URI (which identifies which resource these rules should apply to) and token policy. Earlier, we built two individual services that deal with "building access management" but now we can define a single logical resource to which we apply rules. Specifically, define a logical resource (appliesTo value) named http://localhost/BuildingAccessManagementService that is used by the two previously-built services to validate incoming claims.

  9. The most important part of the scope is the actual rules that drive the claim issuing behavior. We have services that both create and revoke employee access permission to company buildings, and we want to limit who can execute those actions. Any employee is allowed to submit a request for building access, but only site managers have permission to revoke access. Before constructing the claims that govern service authorization, we will build a simple rule that passes along the email address of the vendor to our service.

  10. First, underneath our new scope, create a PassThrough rule that takes the email address of the vendor and copies the provided value to a selected output claim named PartnerContactEmail.

  11. Next, create the rules that our services will use to accept or reject the vendor data. Underneath the same scope, create a rule named ActivityPermission_Create of type Simple and set the Issuer to Riley Semiconductor with a Type of Group and a Value of Employee. What we just did was define an input claim where we are checking if our Issuer (our vendor) gave us a "Group" claim indicating that the service caller is an employee. The output claim type is ActivityPermission with a value of Create.

  12. Define another rule named ActivityPermission_Remove that uses a claim type of Group but has a value of SiteManager. The output claim is of type ActivityPermission and has a value of Revoke.You can imagine when we have a dozen vendors that being able to map a diverse set of input claims to a single output claim is a powerful concept!

  13. Save your changes to the AC STS by clicking the Save to Cloud button on the AcmBrowser application toolbar.

What we have done here is define a set of rules that our services can now leverage when confirming that the service caller is authorized to perform the action requested.