 |
JAAS Portlet
Description
The JaasPortlet? is a simple portlet that demonstrates the capabilities of the Java Authentication and Authorization Service (JAAS) . JAAS is a set of APIs that enable services to authenticate and enforce access controls upon users. It implements a Java technology version of the standard Pluggable Authentication Module (PAM) framework, and supports user-based authorization. This allows an application to remain independent from the underlying authentication technology. An implementation for a particular authentication technology is specified in a login configuration file and is determined at runtime.
Please review the JAAS Tutorial for a detailed tutorial that demonstrates various aspects of JAAS.
Prerequisites for Deployment
None. The portlet can be directly deployed into any JSR 168 compliant container without any additional configuration.
Deployment Steps
- Deploy the portlet to your Portlet Container. For your convenience, the "How To" section on project wiki page will help you get started with a few popular portlet containers.
- Specify the Login Configuration File in the Java Security Properties file.
This is probably the most straightforward approach without explaining how to set the login configuration file in each webcontainer implmentation. Please refer to Appendix A: JAAS Settings in the Java.security Security Properties File for detailed information explaining how to set Java security properties file.
- Locate your
java.security master security properties file. A number of JAAS-related settings can be configured in the java.security master security properties file, which is located in the lib/security directory of the Java 2 runtime.
- Edit the
java.security master security properties file and uncomment the entry for login.config.url.1 . For example, the uncommented property should be similar to:
login.config.url.1=file:${user.home}/.java.login.config
Based on this setting, the authentication configuration file needs to exist at ${user.home}/.java.login.config
Specifying the Login Configuration using the Open Source Portlet Container on GlassFish?
Please refer to the Open Source Portlet Container project site for more information. This Portlet Container runs on GlassFish
- Edit the file
/glassfishdir/domains/domain1/config/login.conf and add the entry found in the file jaasportlet/src/conf/java.login.config . For example,
Authenticate {
com.sun.portal.jaasportlet.providers.JaasAuthFileModule required;
};
Tested On
- Apache Pluto 1.0.1
- Open Source Portlet Container 1.0
Functionality
The JAASPortlet provides a simple user interface for authentication. This portlet does not have an edit view (edit mode). Here is a view of the portlet (view mode).
|