| Form-based Authentication Sample Application |
Form-based Authentication Sample Application
This document describes how to use the Form-based Authentication sample application with Sun Java System Web Server.This sample application document contains the following sections:
- Overview
- Compiling and Assembling the Sample Application
- Deploying the Sample Application
- Running the Sample Application
- Undeploying the Sample Application
- Troubleshooting
Overview
The following instructions describe how to manually deploy the application. You might want to experiment by modifying and redeploying the sample.
Precompilation Tasks
Complete these prerequisites before you begin to compile and deploy the code.You must add user names in the keyfile. To do so, complete the following steps:
- Log on to the Administration GUI.
- Click the Configurations tab.
- Select the correct configuration.
- Click the Access Control tab.
- Click the Users tab.
- Select the correct Authentication Database. Make sure it's the keyfile database and pointing to the default keyfile.
- Click the New button and enter the following information:
- Enter j2ee for the User ID.
- Enter secret for the Password.
- Enter secret for the Password (Again).
- Click OK.
- Click the Groups tab.
- Select the correct Authentication Database. Make sure it's the keyfile database and pointing to the default keyfile.
- Click the New button and enter the following information:
- Enter staff for the Group Name.
- Click Search button.
- Select the user j2ee.
- Click OK.
- Click Deploy.
Compiling and Assembling the Sample Application
To compile and assemble the form-based security web sample application:
Note - Make sure that the necessary parameters for running the samples are specified in install_root/samples/java/webapps/common.properties.
- Set the keyfile.location property within the install_root/samples/java/webapps/security/auth.build.properties file.
- Change to install_root/samples/java/webapps/security/form-auth/src and execute the ant command.
The default target default is executed to build the WAR file..
- Deploy the application.
- After you have created the sample application from scratch, you can proceed to Deploying the Sample Application.
- (Optional.) Clean the web application project area.
Deploying the Sample Application
To deploy the form-based security sample application:If you want to verify the registration of the application, proceed to Verifying Deployment. Otherwise, proceed to Running the Sample Application.
- Change to the source directory at install_root/samples/java/webapps/security/form-auth/src.
- Run ant using the deploy task:
To verify the registration and deployment of the application, complete the following steps:
Running the Sample Application
You can run the application through the following URL:http://Sun_Java_System_Web_Server_hostname:port/webapps-formbased-security
Log on as j2ee with password secret.
The message "You are Authenticated Successfully!" is displayed.
Undeploying the Sample Application
After successfully deploying and running the application, you might decide to undeploy it and remove the files. To undeploy the application, complete the following steps:
- Change to the source directory at install_root/samples/java/webapps/security/form-auth/src.
- Run the ant tool using the undeploy task.
Troubleshooting
- Close all browser instances before you try to log in again; if you are using Netscape, you must also close the email session. Otherwise, session information from the previous logins will be picked up to grant access for you.
- While appending data to the keyfile, make sure that the user names entered are unique.
- If you encounter problems when running the application, review the log files at instance_root/logs/errors to determine what went wrong.