Export (0) Print
Expand All

Running the Perl QuickStart Sample

Bb676623.note(en-us,MSDN.10).gifNote:
This topic describes functionality that will be obsolete. This functionality is provided only to support legacy applications. Live Connect incorporates features that provide equivalent functionality.

This topic explains how to install, run, and extend the QuickStart sample provided in the Perl programming language.

Bb676623.note(en-us,MSDN.10).gifImportant:
The Perl QuickStart sample is preconfigured to use default values for the client ID, secret key, and return URL parameters. The return URL is preconfigured to point to http://localhost/webauth/sample/webauth-handler.cgi. For more information about how to customize these parameters, see Getting Your Client ID for Web Authentication.

When you install the sample, you put its files in the correct locations on your Web server. In this discussion, we assume that you have direct access to your Web server and that you develop and browse your site from the server.

Bb676623.note(en-us,MSDN.10).gifImportant:
To run these samples, you must install Perl version 5.8 or later.

To install the sample

  1. On an openSUSE 10.3 Linux platform, ensure that the apache2, perl, perl-URI, perl-libwww-perl, perl-XML-Simple, perl-Mcrypt, and gcc packages are installed by means of the YaST tool. Some of these packages may not be available on the distribution DVD but may be obtained from the openSUSE download site (http://download.opensuse.org/distribution/10.2/repo/oss/suse/i586/).
  2. Obtain and install the Digest-SHA Perl module from CPAN (http://search.cpan.org/~mshelor/Digest-SHA-5.44/SHA.pm).
  3. Sign in as the superuser by issuing the su command.
  4. Go to the /etc/apache2/ directory and use a text editor to open the default-server.conf file.
  5. Locate the <Directory "/srv/www/htdocs"> section (where "/srv/www/htdocs" is the document root for http://localhost/) and change the AllowOverride None line to AllowOverride All. This modification permits the .htaccess file that is included in the Web Authentication Perl package to take effect. You can inspect this file and make changes directly in the Apache configuration if you do not want to enable .htaccess overrides on the localhost.
  6. Save the default-server.conf file and reload the Apache configuration by issuing the following command: /etc/init.d/apache2 reload
  7. Go to the /srv/www/htdocs directory and uncompress the Perl package by issuing the following command: tar -zxvf <path>/webauth-perl-1.2.tar.gz where <path> is the path to the webauth-perl-1.2.tar.gz file that you downloaded.
  8. Rename the webauth-perl-1.2 directory to "webauth" so that http://localhost/webauth/sample/ is the URL entry point for the QuickStart sample.

The Perl QuickStart sample is installed.

Bb676623.note(en-us,MSDN.10).gifImportant:
Included in the QuickStart sample is a file named Application-Key.xml. Make sure that the folder that contains this file cannot be accessed from the Internet, because the file contains important confidential information.

After you install the sample, you can run it to see a demonstration of how Windows Live ID works.

To run the sample

  1. Go to http://localhost/webauth/sample/.
  2. Click Sign in. You are directed to the Windows Live ID sign-in page.
  3. Type your valid Windows Live ID and password to sign in. You are redirected to the sample application. The Sign-in link has now changed to Sign out.
  4. In the Name text box, type your name and then click Submit. Your name is stored and associated with your user ID for use when you sign in from now on.
  5. Click Sign out. You are signed out.

Before you can extend the sample, you must first register your application as described in Getting Your Client ID for Web Authentication. After you register your application, substitute your own client ID and secret key for the default values specified in the Application-Key.xml configuration file in the sample application.

Now you're ready to explore ways to develop the sample code further to meet your site's needs. Look through the Perl library in the file named WindowsLiveLogin.pm to see what additional functionality is available to you. You can also read the topics in the Web Authentication Reference section for even more information about how Web Authentication works.

You can also customize the sign-in and registration pages that your users experience. For more information, see Customizing Sign-in and Registration.

Finally, you can share your discoveries and learn from others by participating in the Windows Live ID Development Forum. See you there!

Other Resources

Live Connect

Show:
© 2014 Microsoft