Running a JClient Login Dialog for JAAS

To use the login dialog with OracleAS JAAS Provider and the embedded OC4J server, the following configurations are required before running the JClient form.

Note: If you prefer not to use OracleAS JAAS Provider, you can modify the generated login dialog to work with a JDBC connection.

To configure an ADF Business Components client to use SSO authentication:

  1. In the Navigator, right-click the application's top-level application module and choose Configurations.
  2. In the Configuration Manager, select the configuration your application uses and click Edit.
  3. In the Oracle Business Component Configuration dialog, select the Properties tab.
  4. Find the property jbo.security.enforce.
  5. Set this property to Must to enable full authentication.

To enable the login provider for JClient forms:

  1. Open the file <jdev_install >/jdk/jre/lib/security/java.security in your editor and insert this ADF Business Components security configuration definition:

    login.configuration.provider=oracle.security.jazn.spi.LoginConfigProvider

  2. To add the BC4J security JAR file to your project, select the JClient project in the Navigator and choose P roject | Project Settings.
  3. In the Project Settings dialog, click Libraries under the Configurations tree to display the current list of libraries associated with your JClient project.
  4. From the list of Available Libraries , locate BC4J Security and add it to the list of Selected Libraries.

    Otherwise an error message will get displayed when using the logon dialog. The BC4J Security library contains the JAR files required to use JAAS within the project.

  5. Click OK to save the project settings.
  6. If your JClient project requires access to ADF Business Components deployed as an EJB session bean, you must grant read/write access to the users in your group.

To run in OC4J:

  1. Make sure that at least one data control exists for the login form (for example, based on an ADF Business Components project) by dragging and dropping a component from the Data Control Palette onto the form or a panel.

    When creating an application with an empty JClient form, no data control is created by default. The ADF data control provides the data binding context for the application.

  2. Navigate to the <jdev_install>/j2ee/home directory and open a command prompt window.

  3. Type the following command to start OC4J:

    java -jar oc4j.jar

    If this doesn't start OC4J, then the java command may not be in the path. Add the bin directory of your JRE installation to the system path if this happens. The OC4J container must be started to allow the JAZN provider to serve as the logon module.

User accounts are stored in the jazn-data.xml file located in the <jdev_install>/j2ee/home/config directory. One of the default names in here is SCOTT/TIGER (note, uppercase). To test your logon dialog, use the default names.

The jazn-data.xml file encrypts the password the first time OC4J gets started after an account is added. To make sure a password is encrypted, add an '!' in front of the password. For example, to encrypt the password WELCOME, define it as !WELCOME.

To further work with the username/credential pair for your users, use the following code in your application:

Hashtable h = panelBinding.getBindingContext().getDefaultDataControl(). getApplicationModule().getSession().getEnvironment();

String username = h.get(JboContext.SECURITY_PRINCIPAL);
String credential = h.get(JboContext.SECURITY_CREDENTIALS);


About the JClient Login Dialog
Modifying the JClient Login Dialog for JDBC

 

Copyright © 1997, 2004, Oracle. All rights reserved.