Hosting / Deploying WIF enabled application on Windows Azure – Tech Ed India 2011 Live
March 23, 2011
Posted by on
Hello Folks, hope you had a great time attending the session as much we had presenting it. Thanks for your applause 🙂 . Below are the simple steps to replicate the glitch free demo I showcased. So just go ahead and gets your hands on WIF and Windows Azure.
System setup would need VS.NET 2010, Windows Azure SDK 1.4, WIF Runtime, WIF SDK, Windows Azure Account and a AppFabric Labs account. To start with create a new ASP.NET MVC 2 web application.
Just head to Web.config and change the authentication mode to Windows
Run the application and your page should show your identity something like below (you can change the Site.Master and HomeController.cs)
Next we are all set to outsource the authentication to STS. I have used SelfSTS here but you might as well use a ADFS V2. Below are the snapshots of the claims that are part of my SelfSTS and SelfSTS in a running mode
After starting SelfSTS head back to your VS.NET solution and right click your project and select ‘Add STS Reference’ (ensure WIF SDK is installed to get this in your context menu). Add your localhost application URI and copy the Federation URL highlighted earlier (select default for other pages in Wizard and ignore warning for HTTS considering the fact this is a demo application)
Make the below changes to your web.config (latter is required only if you plan to use SecurityTokenVisualizerControl)
You can add authorization code as below to display ‘Welcome Architect’ only if the group claim says you are an architect
It’s time to leverage Access Control Service now as a Federation provider allowing us to connect with multiple identity providers without modifying single line of code. Go to the AppFabric labs portal and sign in with your live ID. Create your service namespace and click on manage access control service
Add an Identity provider which refers to your Local STS, and then a replying party application. Generate Rule Groups and copy the Application Integration URL (I am skipping screen shots expect the one for Identity Provider as they very obvious). Take the Application integration FedMedata URL and repeat the process we did earlier with Self STS but for Application URI you need to specify your Cloud Application URL. Ensure you set Copy Local to True for System.IdentityModel and System.Web.MVC DLLs. That’s it!!! Go ahead and deply your application on cloud and sign in to access your cloud application using WIF
Here’s the link to hosted version of the application. You must have local STS running to test it. Enjoy 🙂