It would be fair to say that I have struggled for years to get Windows Communications Foundation (WCF) services to work well with Microsoft’s Access Control Service (ACS). I’ve written dozens of such services, but it’s always been harder than it should.
Needless to say, I lay most of the blame at Microsoft’s feet. A ton of “How-Tos” have been published, but the examples have overwhelmingly fallen short in one way or another. Now don’t get me wrong. I wouldn’t have made the least bit of progress without the various demos and write-ups (by Microsoft and otherwise), and I very much want to thank their authors. Even so, the problem space is way too huge to get good traction without a sample that does works extra hard to to help you get up and working!
My demo (AcsDemo) has only four steps (five, if you include downloading the code; six if you consider reading this article an actual step!) In contrast, the typical MS how-to has dozens of steps to perform. To take one obvious example, if you wanted to use ACS to secure a WCF service then in all likelihood you’d start with the “Authenticate with a Username and Password to a WCF Service Protected by ACS” how-to. This little gem has 67 distinct steps; many of which have multiple parts. More maddening still, there’s a bunch of stuff “outside” of the demo itself that you have to figure out how to do on your own.
Now, to be totally fair, like all of the other demos, I can’t do the first three “pre-tasks” for you, but even so, these links should help:
- You need a current Azure Subscription to run the demo
- You can get a free 3-month trial by clicking the “try it free” button on the main Azure page
- Once you have an Azure subscription, you need to get an ACS Namespace
- Finally, you can download my AcsDemo solution then open the README.doc file
- It’s located in the solution root
If you’ve got your ACS Namespace then the rest should be a cakewalk (famous last words!). Really! The only tasks left to do are:
- Update the “Settings.xml” file (in the “Settings folder” off the solution root)
- Run the “RunToSetupACS” utility to update ACS via the ManagementService
- Run the AcsDemo.Client application
- You may want to run AcsDemo.Website first, so you can step into the service code
- Look through the code and see what’s going on
That’s it. Good luck, and please feel free to email me whether it word for you or not. I’d love to help….