Skip Headers

Oracle9iAS Containers for J2EE Services Guide
Release 2 (9.0.2)

Part Number A95879-01
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

5
Quick Start JAAS Provider Demo

This chapter describes how to quickly configure and run a sample Java2 Platform, Enterprise Edition (J2EE) application that uses the JAAS Provider, the Oracle9iAS Containers for J2EE (OC4J) user authentication, authorization, and delegation service.

This chapter contains these topics:

Quick Start JAAS Provider Demo Overview

This Quick Start demo is designed to get you up and running with JAAS provider using the sample demo application, callerInfo. It also demonstrates the use of the JAZN Admintool.

The callerInfo demo indicates whether or not the user attempting to log into the application has succeeded and with which roles and permissions.

The callerInfo demo application demonstrates use of the following features:

Setting Up the Demo

These are the basic tasks you must perform to set up the Quick Start demo:

Task 1: Modify OC4J Configuration Files

In order to use the callerInfo demo, you must modify two OC4J files in $ORACLE_HOME/j2ee/home/config/.

  1. Modify the server.xml file by removing the comments around :

    <application name="callerInfo" path="../jazn/demo/callerInfo/callerInfo.ear" />
    
    
  2. Modify the default-web-site.xml file by removing the comments around :

    <web-app application="callerInfo" name="callerInfo-web" root="/jazn" />
    
    

    See Also:

    • Oracle9iAS Containers for J2EE User's Guide for further information on OC4J configuration

    • Oracle9i Application Server Security Guide for further information on JAAS Provider configuration

Task 2: Change Default Configurations (Optional)

The sample callerInfo application is installed with several default configuration settings that enable you to immediately run the JAAS provider. If you want to run the JAAS provider using these default settings, you can skip this section and go to "Running the Demo".

If you make any changes to the default configurations, rebuild the directory with jar or Ant.

For the purpose of this demo, two different realms are available for experimentation. Realms provide access to users and roles. The two realms are contained in jazn-data.xml files located in the directory j2ee/home/jazn/config/:

To use a realm other than the default sample_subrealm, you must modify the jazn element of the OC4J orion-application.xml (in the directory jazn/demo/callerinfo/etc/) as follows:

Running the Demo

To start OC4J and connect to the demo application:
  1. Start OC4J with the JAAS provider as follows:

    java -jar oc4j.jar
    
    

    For the purposes of this Quick Start demo, an insecure and simple manner for starting OC4J is presented. For more information about starting OC4J in secure mode, see "Starting an Application".

  2. Run the callerInfo application from a Web browser:

    http://hostname:8888/jazn
    
    
  3. Follow instructions on the Web page.

  4. Log in with either of the following usernames and passwords:

Viewing the Results of the callerInfo Demo

When the call to the callerInfo demo application is successful, with the username user, for example, the browser displays a message similar to the following:

Time stamp: Fri Aug 24 19:11:37 PDT 2001 request.getRemoteUser =
sample_subrealm/user
request.isUserInRole('FOO') = false
request.isUserInRole('ar_manager') = false
request.isUserInRole('ar_developer') = true
request.getUserPrincipal = ([JAZNUserAdaptor: user=[XMLRealmUser:
sample_subrealm/user])

In summary, this Quick Start demo performed the following:

Testing the JAZN Admintool

The JAZN Admintool is a Java console application that manages provider data from the command prompt.

You can invoke the JAZN Admintool from the UNIX command line interface as follows:

java -jar jazn.jar -listusers sample_subrealm

These are a few of the command options that you can experiment with from a command-line interface.

-listusers [realm [-role role|-perm permission]] 
-listroles [realm [user|-role role]|-perm permission] 
-listrealms 
-listperms {realm user |-role role|-realm realm} 
-help

The JAZN Admintool also includes a shell. The following screen listing shows how to access the JAZN Admintool shell and some basic shell commands that you can run, with results.

> java -jar jazn.jar -shell
JAZN:> ls
realms       policy
JAZN:> cd realms
JAZN:> ls
sample_subrealm

JAZN:> cd sample_subrealm
JAZN:sample_subrealm> ls
users        roles
JAZN:sample_subrealm> cd users
JAZN:sample_subrealm> ls
admin
rachel
naresh
ray
stella
anonymous

JAZN:sample_subrealm> add scott tiger
JAZN:sample_subrealm> ls
anonymous
rachel
ray
scott
stella
admin
naresh

JAZN:sample_subrealm> rm scott
JAZN:sample_subrealm> ls
admin
rachel
naresh
ray
stella
anonymous

JAZN:sample_subrealm> exit
JAZN:sample_subrealm>

See Also:

"Using the JAZN Admintool"


Go to previous page Go to next page
Oracle
Copyright © 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index