Running the Java 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 Java programming language.

The Java 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:8080/webauth/sample/webauth-handler.jsp. 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 Java version 5.0 or later.

To install the sample

  1. Make sure that Java Platform, Enterprise Edition (Java EE) with the Java Development Kit (JDK) is installed from the Sun Developer Network (
  2. For purposes of this sample we assume that Java EE was installed with mostly default options, so that the server will be running on the localhost on port 8080. Hence we assume that the sample Web Authentication handler will be accessible at http://localhost:8080/webauth/sample/webauth-handler.jsp by default.
  3. Unzip the package and go to the webauth-java-1.2 directory.
  4. Modify BuildAndDeploy.cmd to suit your system settings.
  5. Run BuildAndDeploy.cmd.

The Java 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

  1. Go to http://localhost:8080/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 Java library in the file named 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