Friday, February 11, 2011

Setting up and using the SecurityTokenVisualizer Control

From my previous post Installing the SecurityTokenVisualizer Control you should now be able to begin setting up and configuring the control for use in debugging your applications.

However, this is not such an easy task as it may seem and requires quite a number of steps in order to be able to use the sample application provided.

IIS Settings


As part of the SecurityTokenVisualizer Control setup, you will need to verify that IIS is setup and running correctly.

Server Certificates

  1. Open up Internet Services Manager
  2. At the root of the IIS Console, click on Server Certificates
  3. Verify that there is a Server Certificate listed that states STSTestCert
  4. Right click on the Server Certificate and select the View menu item
  5. Click on the Details tab
  6. Select the Thumbprint list item
  7. Copy the Thumbprint value to the clipboard or to notepad etc.
  8. Click the OK button




SSL Settings

  1. Now, you must configure the website for the FabrikamAirlines Sample with SSL (this should usually be the Default Web Site)
  2. Right click on the Default Web Site
  3. Select Edit Bindings
  4. Click on the Add button
  5. Select https as the Type
  6. From the list of available SSL Certificates, select STSTestCert
  7. Click the OK button
  8. Now you must ensure that the respective Web Applications in Default Web Site are configured to use SSL
  9. Click on the CloudyBuddiesSTS Web Application
  10. Select SSL Settings 
  11. Check the checkbox for Require SSL
  12. Repeat steps 9-11 for the FabrikamAirlinesWebSite Web Application



Visual Studio Solution

Now that you have properly configured IIS, you can begin working with the Visual Studio Solution.

  1. Open the FabrikamAirlinesSample.sln solution file in Visual Studio. (located at SecurityTokenVisualizerControl\code\FabrikamAirlinesSample)
  2. The Visual Studio solution should contain both the CloudyBuddiesSTS Web Site as well as the FabrikamAirlines Web Site
  3. Open the web.config file beneath the FabrikamAirlines Web Site
  4. Locate the following element: 
  5. <issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <trustedIssuers> <add thumbprint="0E2A9EB75F1AFC321790407FA4B130E0E4E223E2" name="CN=STSTestCert"/> </trustedIssuers> </issuerNameRegistry>
    5.  For the thumbprint attribute, replace the value currently present with the value you copied earlier from the Server Certificate.  Be sure to remove all the spaces between all of the characters.
    6.  For the name attribute, enter the Url for the CloudyBuddies STS Web Site.  This will usually be something like https://localhost/CloudyBuddiesSTS/
    7.  Save your changes to the web.config file
    8.  Now, from the FabrikamAirlines Web Site, select View in Browser for Default.aspx
    9.  If all goes well, you should now be able to view the contents of the SAML Token generated by Windows Identity Foundation using the SecurityTokenVisualizer Control!




    No comments:

    Post a Comment