Up until this series, there was little out there, in terms of web technology, that we could use to demo Microsoft’s Bring Your Own technologies.
Profile gravatar of Sander Berkouwer

Sander Berkouwer

Sander Berkouwer is a Microsoft Certified Professional and a Microsoft Most Valuable Professional (MVP) with over a decade of experience in IT.
Profile gravatar of Sander Berkouwer

To show off claims-based authentication and the ability to make authorization decisions based on these claims, we’ll need a claims-enabled web application on a claims-aware webserver.

Let’s go right ahead and configure that very webserver!

Step 12: Configure the webserver ^

Just like the ADFS server, we’re going to have to bolt our webserver to our Active Directory–based identity platform:

  1. Log on to server WebServer.
  2. Press Win + X or right-click the Start button. In the context menu, select System.
  3. In the main pane, select Change settings in the Computer name, domain and workgroup settings section.
  4. On the System Properties window, click Change…
  5. On the Computer Name/Domain Changes window, select the Domain: option. Type the domain name, and then click OK.
  6. Restart server WebServer.

Also, for secure communications to the Internet, we’d want a certificate to protect HTTP communications with Secure Sockets Layer (SSL).

Next, let’s get a certificate from the Certification Authority (CA):

  1. Log on to server WebServer with domain credentials.
  2. Click the Start button.
  3. Type mmc.exe and press Enter.
  4. This will start an empty Microsoft Management Console window.
    On the Console1window, from the File menu, select Add/Remove Snap-in…
  5. On the Add or Remove Snap-ins window, select Certificates from the list of available snap-ins and click Add >.
  6. Select Computer account and click Next >.
  7. Select Local Computer and click Finish.
  8. On the Add or Remove Snap-ins window, click OK.
  9. In the left pane, expand Certificates (Local Computer), then Personal, and then Certificates.
  10. In the Action pane (to the right), click More Actions, click All Tasks, and then click Request New Certificate….
  11. On the Certificate Enrollment window, click Next twice.
  12. Select Web Server.
  13. Click the link More information is required to enroll for this certificate. Click here to configure settings.
  14. On the Certificate Propertieswindow, perform these actions:
    1. In the Subject name: area, change the Type: to Common Name and then type webserver.demo.4sysops.com. Click Add >.
    2. In the Alternative name: area, change the Type: to DNS and then type webserver.demo.4sysops.com. Click Add >.
    3. Also in the Alternative name: area, change the Type: to DNS and then type www.demo.4sysops.com. Click Add >.
  15. Click OK when done.
  16. Click Enroll.
  17. Click Finish.
  18. Close the Microsoft Management Console window. You don’t need to save it.

Step 13: Install a custom webserver role with the WIF SDK ^

To build the demo websites, we’ll need to download some bits to the WebServer server. We’ll need the following bits:

Although you could download the WIF SDK on the host itself, for the SXS folder this isn’t necessarily the ideal way. We’ll only need a small portion of the contents of the Windows Server 2012 R2 DVD, and the virtual hard disk of our webserver won’t be compressed after we throw the rest out.

Instead, I opt to use the Connected Resources option in the Terminal Services Client (mstsc.exe) to connect a local hard drive from the device I use to connect to the WebServer server. This way, I’ll be able to use the setup files without adding them to the contents of the virtual hard disk of the WebServer server.

Tip!
You might not have the Windows Server 2012 R2 DVD laying around. To get access to the Windows Server 2012 R2 DVD, register for the Windows Server 2012 R2 trial and download the virtual DVD file (*.iso) file. Mount it and then copy the SXS folder from it to the disk you connected to the WebServer server Terminal Services connection.

We’ll use the two data sources above to install a custom webserver. Perform these tasks:

  1. While logged on as a Domain Administrator, go to Server Manager.
  2. In the top grey pane, click Manage and then select Add Roles and Features from the context menu.
  3. Click Next > on the Before You Begin page of the Add Roles and Features Wizard.
  4. Click Next > on the Select Installation Typepage to accept the Role-based or feature based installation option.
  5. Click Next > on the Select Destination Server page.
  6. On the Select Server Rolespage, select Web Server. Click Next >.
  7. On the Select Features page, select Windows Identity Foundation 3.5. Click Next >.
  8. Scroll down. Expand Application Development and select Asp.Net 3.5. Click Next >.
  9. Before you click Install, follow the Specify Alternate Source Path link. Specify the path to the Windows Server 2012 R2 SXS folder.

After installation, click Close on the Installation Progress page.

Next, we’ll install the WIF SDK.

This is a straightforward installation. Simply run WindowsIdentityFoundation-SDK-3.5.msi and click Next four times. Then, click Install. Upon installation completion, click Finish.

Step 14: Create the ClaimsApp ^

To demo the power of claims, we’ll create a website that displays all claims in a default Active Directory Federation Services (AD FS) claims ticket. Luckily, we won’t have to create this website from scratch, since the WIF SDK contains a pretty decent template for this. Perform these steps:

  1. Copy the contents of the PassiveRedirectBasedClaimsAwareWebApp folder from C:\Program Files (x86)\Windows Identity Foundation SDK\v3.5\Samples\Quick Start\Web Application to C:\Inetpub\ClaimApp.
  2. In this newly created folder, open default.aspx.cs with the built-in Windows text editor (notepad.exe).
  3. Use Ctrl + F to search for instances of ExpectedClaims. Comment out the second instance, including the brackets on the line under it and the three lines under the instance:
    DefaultAspCs in NotePad with correct comments
  4. Use Ctrl + S to save these changes.
  5. Use Ctrl + O to open another file in the same folder: Web.Config.
  6. Use Ctrl + F, but this time use it to search for Microsoft.IdentityModel. You’ll find it somewhere five-sixths of the way through.
  7. Delete the section.
  8. Use Ctrl + S to save these changes.
  9. Use Alt + F4 to close Notepad.

Concluding ^

We’ve created a claims-aware application from the WIF SDK examples and tailored it to our needs. Now, all that is left is to create the trusts and supply the right settings in Internet Information Services (IIS) Manager and between the webserver and the AD FS server. We’ll cover that in Part 6.

Win the monthly 4sysops member prize for IT pros

Share
0

0 Comments

Leave a reply

Your email address will not be published. Required fields are marked *

*

CONTACT US

Please ask IT administration questions in the forum. Any other messages are welcome.

Sending
© 4sysops 2006 - 2017

Log in with your credentials

or    

Forgot your details?

Create Account