08.01.2015 Views

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

240<br />

CHAPTER 10 ■ .<strong>NET</strong> 3.0: PROGRAMMING WITH CARDSPACE<br />

Figure 10-8. The CardSpace card has signed you into the site.<br />

Creating a <strong>Web</strong> Site That Uses CardSpace<br />

The previous example demonstrated how a web site can use CardSpace on the client site<br />

to request <strong>and</strong> receive client credentials. In this section, you’ll step through what it takes<br />

to build this application <strong>and</strong> run it on IIS. While CardSpace works on IIS 5, 6, <strong>and</strong> 7, this<br />

tutorial demonstrates installing certificates on IIS 7.<br />

Preparing Your <strong>Development</strong> Environment for CardSpace<br />

Your development environment will need some configuration before you can use Card-<br />

Space effectively. Before you do anything else, make sure that you have the Windows SDK<br />

installed. Within the Windows SDK, find the file WCFSamples.zip in the samples directory. In<br />

here, you’ll find the technology samples folder containing CardSpace samples.<br />

Look at the UsingCardSpacewithIE7 sample (note that CardSpace is not supported<br />

on earlier versions of Internet Explorer) <strong>and</strong> open the setup.bat file, using Notepad to<br />

inspect it.<br />

Each CardSpace sample uses a similar setup, <strong>and</strong> they all follow the same four steps.<br />

Execute the setup.bat file to install the sample. The next sections will describe how it sets<br />

up CardSpace on your server.<br />

Step 1: Registering CAPICOM.dll<br />

The batch file should register CAPICOM.dll for you. On some systems this fails, so if you<br />

are having trouble installing the CardSpace samples, register it manually. You do this by<br />

changing to the Bin folder in the Windows SDK directory <strong>and</strong> issuing the following comm<strong>and</strong><br />

from a DOS prompt:<br />

Regsvr32 /s capicom.dll

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!