Running the Ruby QuickStart Sample
|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 Ruby programming language.
|The Ruby 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.
|To run these samples, you must install require Ruby version 1.8.5 or later.|
To install the sample
On an openSUSE 10.3 Linux platform, make sure that Apache 2 and Ruby are installed by means of the YaST tool.
Sign in as the superuser by issuing the su command.
Go to the /etc/apache2/ directory and use a text editor to open the default-server.conf file.
Locate the <Directory "/srv/www/htdocs"> section (where "/srv/www/htdocs" is the document root for http://localhost/) and change the
AllowOverride Noneline to
AllowOverride All. This modification permits the .htaccess file that is included in the Ruby 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.
Save the default-server.conf file and reload the Apache configuration by issuing the following command: /etc/init.d/apache2 reload
Go to the /srv/www/htdocs directory and uncompress the Ruby package by issuing the following command: tar -zxvf <path>/webauth-ruby-1.2.tar.gz where <path> is the path to the webauth-ruby-1.2.tar.gz file that you downloaded.
Rename the webauth-ruby-1.2 directory to "webauth" so that http://localhost/webauth/sample/ is the URL entry point for the QuickStart sample.
The Ruby QuickStart sample is installed.
|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
Go to http://localhost/webauth/sample/.
Click Sign in. You are directed to the Windows Live ID sign-in page.
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.
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.
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 Ruby library in the file named WindowsLiveLogin.rb 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!