OC4J Security Guide
OC4J Security Guide
Security Guide
10g (10.1.3.1.0)
B28957-01
October 2006
Oracle Containers for J2EE Security Guide, 10g (10.1.3.1.0)
B28957-01
Contributor: Ganesh Kirti, Raymond Ng, Rachel Chan, Nithya Muralidharan, Kumar Valendhar,
Moushmi Banerjee, Dheeraj Goswami, Sam Zhou, Srikant Tirumalai, Sirish Vepa, Vineet Garg, Bill Bathurst,
Debu Panda, Steve Button, Tom Snyder, Jeff Trent, Bob Nettleton, Vinay Shukla, Alex Kosowski, Rajbir
Chahal, Michael Hwa, Jayanthi Kulkarni, Kavita Tippana, Helen Zhao, Sandeep Bangera, Cania Lee Chung,
Deepika Damojipurapu, Lakshmi Thiyagarajan, Soumya Aithal, Serouj Ourishian, Phil Varner, Chaya
Ramanujam, Xiaopeng Wu, Jyotsna Laxminarayanan, Lelia Yin, Raghav Srinivisan, Sam Chou, Bhupindra
Singh, Ashish Kolli, Frank Nimphius, Dan Hynes, Steve Button, Viresh Garg, Alfred Franci, Peter LaQuerre
The Programs (which include both the software and documentation) contain proprietary information; they
are provided under a license agreement containing restrictions on use and disclosure and are also protected
by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly,
or decompilation of the Programs, except to the extent required to obtain interoperability with other
independently created software or as specified by law, is prohibited.
The information contained in this document is subject to change without notice. If you find any problems in
the documentation, please report them to us in writing. This document is not warranted to be error-free.
Except as may be expressly permitted in your license agreement for these Programs, no part of these
Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose.
If the Programs are delivered to the United States Government or anyone licensing or using the Programs on
behalf of the United States Government, the following notice is applicable:
U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data
delivered to U.S. Government customers are "commercial computer software" or "commercial technical data"
pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As
such, use, duplication, disclosure, modification, and adaptation of the Programs, including documentation
and technical data, shall be subject to the licensing restrictions set forth in the applicable Oracle license
agreement, and, to the extent applicable, the additional rights set forth in FAR 52.227-19, Commercial
Computer Software--Restricted Rights (June 1987). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA
94065.
The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently
dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup,
redundancy and other measures to ensure the safe use of such applications if the Programs are used for such
purposes, and we disclaim liability for any damages caused by such use of the Programs.
Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective owners.
The Programs may provide links to Web sites and access to content, products, and services from third
parties. Oracle is not responsible for the availability of, or any content provided on, third-party Web sites.
You bear all risks associated with the use of such content. If you choose to purchase any products or services
from a third party, the relationship is directly between you and the third party. Oracle is not responsible for:
(a) the quality of third-party products or services; or (b) fulfilling any of the terms of the agreement with the
third party, including delivery of products or services and warranty obligations related to purchased
products or services. Oracle is not responsible for any loss or damage of any sort that you may incur from
dealing with any third party.
Contents
iii
Java 2 Security Model .............................................................................................................................. 2-7
Code-Based Security .......................................................................................................................... 2-8
Security Permissions.......................................................................................................................... 2-9
Protection Domains............................................................................................................................ 2-9
Java 2 Authorization: Java 2 Security Policies ............................................................................ 2-10
Java 2 Authorization: Security Managers and Access Controllers .......................................... 2-11
Java Authentication and Authorization Service.............................................................................. 2-12
Principals and Subjects................................................................................................................... 2-12
JAAS Authentication: Login Modules ......................................................................................... 2-13
About Login Modules ............................................................................................................. 2-13
Stacking Login Modules ......................................................................................................... 2-14
JAAS Authorization: JAAS Security Policies .............................................................................. 2-15
JAAS Authorization: Subject Methods doAs() and doAsPrivileged() .................................... 2-15
Security Considerations during Development................................................................................ 2-17
Summary: Comparing Security Models for J2EE, Java 2, and JAAS ....................................... 2-17
Steps to Develop a Secure J2EE Application ............................................................................... 2-18
iv
OC4J System Application .................................................................................................................... 4-10
Summary of OC4J Accounts................................................................................................................ 4-11
Predefined Accounts....................................................................................................................... 4-11
Activation of the oc4jadmin Account (Standalone OC4J) ......................................................... 4-12
Creating and Configuring a New Administrator Account ....................................................... 4-13
Creating a New Administrator Account .............................................................................. 4-13
Configuring a New Administrator Account for the System Application ....................... 4-15
Configuring an Anonymous User ................................................................................................ 4-15
Summary of Configuration Repositories and Security Management Tools.............................. 4-15
5 Authorization in OC4J
Java 2 Security and Code-Based Policy Management ....................................................................... 5-1
Specifying a Java 2 Security Manager and Policy File .................................................................. 5-1
Using PrintingSecurityManager to Determine Required Java 2 Permissions........................... 5-3
Creating or Updating a Java 2 Policy File....................................................................................... 5-3
Authorization APIs, JAAS Mode, and JACC in the OC4J Environment....................................... 5-4
JAAS Authorization and OracleAS JAAS Provider JAAS Mode ................................................ 5-4
Introduction to JAAS Mode....................................................................................................... 5-5
OracleAS JAAS Provider Realm and Policy APIs .................................................................. 5-6
OracleAS JAAS Provider APIs for Granting or Revoking Permissions.............................. 5-7
APIs for Checking Permissions................................................................................................. 5-9
Implementation of Java Authorization Contract for Containers ............................................. 5-11
OracleAS JAAS Provider Policy Management ................................................................................ 5-12
Granting Permissions through the OracleAS JAAS Provider Admintool .............................. 5-12
Using OracleAS JAAS Provider Policy Management APIs ...................................................... 5-13
OracleAS JAAS Provider Policy Configuration.......................................................................... 5-14
Policy Repository Setting in jazn.xml ................................................................................... 5-14
Policy Configuration in system-jazn-data.xml .................................................................... 5-15
Policy Configuration in Oracle Internet Directory.............................................................. 5-15
Specification of the Oracle Policy Provider ................................................................................. 5-16
Authorization Coding and Configuration........................................................................................ 5-16
Using J2EE Authorization APIs .................................................................................................... 5-16
Obtaining a Subject ......................................................................................................................... 5-17
Using the checkPermission() Method .......................................................................................... 5-17
Configuring and Using JAAS Mode............................................................................................. 5-18
Enabling the Java Authorization Contract for Containers........................................................ 5-19
System Property to Enable JACC Features .......................................................................... 5-19
System Properties to Specify the JACC Provider ................................................................ 5-20
Authorization Strategies ...................................................................................................................... 5-20
Considering J2EE Security ............................................................................................................. 5-20
Considering Java 2 Security........................................................................................................... 5-21
Considering JAAS Security............................................................................................................ 5-22
v
Specifying a Password Manager in system-application.xml ....................................................... 6-2
Password Obfuscation in OC4J Configuration Files..................................................................... 6-3
Using Security Realms in OC4J............................................................................................................. 6-3
Default Realm with the File-Based Provider or Oracle Identity Management ......................... 6-4
Evaluation of Default Realm for File-Based Provider, Oracle Identity Management.............. 6-4
Using the Default Realm ................................................................................................................... 6-5
Using a Nondefault Realm ............................................................................................................... 6-5
Using Multiple Realms...................................................................................................................... 6-6
Omitting the Realm Name When Retrieving an Authenticated Principal ................................ 6-6
Deployment Tasks for Security ............................................................................................................. 6-7
Overview of Deployment Considerations...................................................................................... 6-7
Deploying an Application................................................................................................................. 6-8
Deploying an Application through Application Server Control ......................................... 6-8
Specifying a Security Provider ......................................................................................................... 6-9
Considering the File-Based Provider Versus Oracle Identity Management ...................... 6-9
Specifying the Security Provider through Application Server Control ............................. 6-9
Mapping Security Roles ................................................................................................................. 6-10
Application Role Definitions and References ...................................................................... 6-10
Specifying Security Role Mapping through Application Server Control........................ 6-11
Mapping J2EE Roles to Deployment Roles in OC4J Configuration Files ........................ 6-12
Using the OC4J PUBLIC Role to Allow General Access by Authenticated Users ......... 6-12
Post-Deployment Tasks for Security ................................................................................................. 6-13
Navigating to the Security Provider Page for Your Application ............................................. 6-13
Tasks to Share a Library ....................................................................................................................... 6-14
Loading the Library as an OC4J Shared Library ........................................................................ 6-14
Importing the Library into Your Application ............................................................................. 6-15
vi
File-Based Provider Settings in OC4J Configuration Files.............................................................. 7-9
Settings in the <jazn> Element for the File-Based Provider ........................................................ 7-9
Scenarios for <jazn> Settings in orion-application.xml...................................................... 7-10
Configuration to Automatically Create an Application-Specific jazn-data.xml File ..... 7-11
Supplying an Application-Specific jazn-data.xml File ....................................................... 7-11
Realm Configuration in the Repository File................................................................................ 7-11
Policy Configuration in the Repository File................................................................................ 7-12
Predefined OC4J Accounts in system-jazn-data.xml ................................................................. 7-12
OracleAS JAAS Provider Migration Tool......................................................................................... 7-13
Overview of the Migration Tool ................................................................................................... 7-13
Migration Tool Command Syntax ................................................................................................ 7-14
Migration Tool APIs ....................................................................................................................... 7-15
Migrating Principals from the principals.xml File ......................................................................... 7-16
Using the File-Based Provider Across an OC4J Group .................................................................. 7-17
OC4J Basic Group Features............................................................................................................ 7-17
Cluster MBean Browser Features and the J2EEServerGroup MBean...................................... 7-18
vii
Relation of JAAS Provider Realms to Oracle Internet Directory Realms ........................ 8-17
Access Control Lists and OracleAS JAAS Provider Directory Entries............................. 8-18
Realm Management for Oracle Identity Management .............................................................. 8-18
Managing Realms in Oracle Internet Directory................................................................... 8-18
Changing Your Default Realm............................................................................................... 8-18
Using Multiple Realms and Oracle Single Sign-On with OC4J ........................................ 8-19
LDAP-Based Provider Settings in OC4J Configuration Files ...................................................... 8-20
Configuring LDAP User and SSL Properties .............................................................................. 8-20
Configuring LDAP Connection Properties ................................................................................. 8-21
Configuring LDAP Caching Properties ....................................................................................... 8-22
Tips and Troubleshooting for the LDAP-Based Provider ............................................................. 8-24
Checking Configuration (JAZN-LDAP) ...................................................................................... 8-24
Using ldapsearch to Retrieve Realm Names from Oracle Internet Directory........................ 8-25
Avoiding OC4J Restart for Oracle Internet Directory Changes to Take Effect ...................... 8-25
Accessing the Oracle Single Sign-On Administration Pages.................................................... 8-25
9 Login Modules
Initial Login Module Considerations................................................................................................... 9-1
Specification of the Oracle Login Configuration Provider .......................................................... 9-1
Login Module Notes and Tips.......................................................................................................... 9-2
Login Modules Supplied with OC4J.................................................................................................... 9-3
RealmLoginModule ........................................................................................................................... 9-4
DBTableOraDataSourceLoginModule ............................................................................................ 9-5
DBTableOraDataSourceLoginModule Options...................................................................... 9-6
Configuring DBTableOraDataSourceLoginModule in Application Server Control......... 9-8
Configuring DBTableOraDataSourceLoginModule in the Admintool............................... 9-8
Sample DBTableOraDataSourceLoginModule Settings in system-jazn-data.xml ............ 9-8
Principals for DBTableOraDataSourceLoginModule ............................................................ 9-9
Implementing DBLoginModuleEncodingInterface for Password Encryption ............... 9-10
Previous Functionality: DataSourceUserManager (Deprecated)...................................... 9-11
Introducing Custom JAAS Login Modules...................................................................................... 9-12
Summary of Choices for Packaging Login Modules...................................................................... 9-13
Packaging Login Modules within the J2EE Application ........................................................... 9-14
Providing Login Modules as Optional Packages ....................................................................... 9-14
Providing Login Modules as OC4J Shared Libraries................................................................. 9-15
Configuring the Custom Security Provider in Application Server Control .............................. 9-15
Specifying and Configuring a Custom Security Provider during Deployment .................... 9-15
Editing a Custom Login Module Configuration during Deployment ............................. 9-16
Adding a Custom Login Module during Deployment ...................................................... 9-17
Changing to a Custom Security Provider after Deployment.................................................... 9-18
Adding a Login Module to the Custom Security Provider....................................................... 9-18
Updating a Login Module in the Custom Security Provider ................................................... 9-19
Deleting a Login Module in the Custom Security Provider ..................................................... 9-19
Using Admintool to Configure Login Modules and Grant RMI Permission ........................... 9-19
Configuring Login Modules through the Admintool................................................................ 9-20
Granting RMI Permission through the Admintool .................................................................... 9-20
Summary of Login Module Configuration in OC4J Configuration Files .................................. 9-21
viii
Login Module Settings in system-jazn-data.xml ........................................................................ 9-21
Login Modules Settings in orion-application.xml...................................................................... 9-22
Settings in <jazn-loginconfig> in orion-application.xml.................................................... 9-22
Settings in <jazn> for Login Modules................................................................................... 9-23
Settings in <namespace-access> for Access to JNDI Context............................................ 9-23
Login Module Settings in oc4j-ra.xml (J2EE Connector Architecture).................................... 9-24
Step by Step: Integrating a Custom Login Module with OC4J.................................................... 9-24
Develop the Login Module ............................................................................................................ 9-24
Configure and Package the Login Module.................................................................................. 9-25
Configuration to Enable Login Module Usage.................................................................... 9-26
Configuration of the Login Module ...................................................................................... 9-26
Configure Namespace Access and Role Mappings (as applicable)......................................... 9-26
Deploy the Login Module.............................................................................................................. 9-27
Grant RMI Permission (as applicable) ......................................................................................... 9-27
Set JNDI Properties (as applicable)............................................................................................... 9-27
Custom Login Module Example......................................................................................................... 9-28
SampleLoginModule Code ............................................................................................................ 9-28
SamplePrincipal Code .................................................................................................................... 9-33
ix
Running the Policy Manager ......................................................................................................... 11-6
Oracle Access Manager Concepts....................................................................................................... 11-6
About Oracle Access Manager Resource Types ......................................................................... 11-6
About Oracle Access Manager Authentication .......................................................................... 11-6
About the Oracle Access Manager Single Sign-On Cookie ...................................................... 11-7
About Using HTTP Header Variables for Authentication........................................................ 11-7
Configuring Oracle Access Manager................................................................................................. 11-8
Configure Oracle Access Manager Form-Based Authentication ............................................. 11-8
Create a Login Form ................................................................................................................ 11-8
Define Form-Based Authentication in Policy Manager ..................................................... 11-9
Configure the credential_mapping Plug-In for Form-Based Authentication ............... 11-10
Configure the validate_password Plug-In for Form-Based Authentication ................. 11-10
Configure Oracle Access Manager Basic Authentication........................................................ 11-10
Define Basic Authentication in Policy Manager................................................................ 11-11
Configure the credential_mapping Plug-In for Basic Authentication ........................... 11-11
Configure the Resource Type ...................................................................................................... 11-12
Configure the Name and Operation of the Resource Type ............................................. 11-12
Configure and Protect the URL of the Configured Resource Type................................ 11-12
Configure the Return Action Attributes............................................................................. 11-13
Protect the Action URL................................................................................................................. 11-13
Configuring OC4J with the Access Manager SDK ....................................................................... 11-14
Create OC4J Instances as Needed............................................................................................... 11-14
Configure the Access Manager SDK to Each OC4J Instance .................................................. 11-14
Configure the Access Manager SDK Library Path for Each OC4J Instance ......................... 11-15
Configuring opmn.xml for Oracle Access Manager..................................................................... 11-15
Creating Required Accounts in the LDAP Server ........................................................................ 11-16
Configuring the Application............................................................................................................. 11-17
Protect the Application URLs in web.xml ................................................................................. 11-17
Settings for Application Deployment ........................................................................................ 11-17
Configure Oracle Access Manager SSO in orion-application.xml ......................................... 11-17
Protect the Application URLs in Oracle Access Manager....................................................... 11-18
Configure the Oracle Access Manager Login Module............................................................. 11-18
Test the Application...................................................................................................................... 11-21
Granting Permissions to Oracle Access Manager Principals...................................................... 11-21
Granting RMI Permission to an Oracle Access Manager Principal ....................................... 11-22
Granting Required Permissions to Additional Oracle Access Manager Principals ............ 11-22
Confirming Configured Realm Names for Oracle Access Manager Principals................... 11-24
Considerations for Oracle Application Server SOA Applications............................................ 11-24
Configure Logout for Oracle Application Server SOA Applications.................................... 11-25
Troubleshooting Login to Oracle Application Server SOA Applications............................. 11-25
Oracle Access Manager Examples for J2EE Applications............................................................ 11-25
Web Application Using HTTP Header Variables through Oracle Access Manager........... 11-26
Configure Name and Password in Policy Manager ......................................................... 11-26
Configure HTTP Header Variables for the Oracle Access Manager Login Module.... 11-26
Secure the Web Application That Uses HTTP Headers ................................................... 11-27
Web Application Using the Oracle Access Manager ObSSOCookie..................................... 11-27
Configure User Name and Password for the Oracle Access Manager Login Module 11-27
x
Secure the Web Application That Uses ObSSOCookie .................................................... 11-27
EJB Application Using Oracle Access Manager........................................................................ 11-28
Oracle Access Manager Support and Examples for Web Services............................................. 11-29
Web Service with Username Token Authentication for Oracle Access Manager ............... 11-29
Web Service with X.509 Token Authentication for Oracle Access Manager........................ 11-31
Web Service with SAML Token Authentication for Oracle Access Manager ...................... 11-32
Troubleshooting the Oracle Access Manager Setup..................................................................... 11-33
xi
Summary of How to Use the Identity Management Framework............................................... 13-16
Sample Use Case: Using a Header-Based Identity Token ........................................................... 13-17
Sample Token Collector: CollectorImpl.java............................................................................. 13-17
Sample Token Asserter: TokenAsserterImpl.java .................................................................... 13-18
Sample Configuration: jazn.xml ................................................................................................. 13-19
xii
Configure AJP over SSL ............................................................................................................... 15-12
Configure AJPS between OC4J and Oracle HTTP Server ................................................ 15-12
Configure OPMN to Support AJPS (Scenario with Oracle HTTP Server)..................... 15-13
Sample Configuration Files for SSL............................................................................................ 15-14
Requesting Client Authentication ................................................................................................... 15-15
Overview of OC4J Client Authentication Mode....................................................................... 15-15
Client Authentication to OC4J..................................................................................................... 15-16
Oracle HTTP Server Authentication to OC4J in Oracle Application Server ........................ 15-17
Client Authentication to Oracle HTTP Server .......................................................................... 15-17
Troubleshooting and Debugging SSL............................................................................................. 15-17
Common SSL Errors and Solutions ............................................................................................ 15-17
General SSL Debugging: javax.net.debug Property................................................................. 15-18
Enabling ORMIS for OC4J................................................................................................................ 15-18
Configuring ORMIS for Standalone OC4J................................................................................. 15-19
Configure server.xml for the RMI Configuration File Location ..................................... 15-19
Configure rmi.xml for ORMIS ............................................................................................. 15-19
Disable ORMI with ORMIS Enabled (Optional) ............................................................... 15-20
Configuring ORMIS for OC4J in an Oracle Application Server Environment .................... 15-21
Configuring ORMIS Access Restrictions ................................................................................... 15-21
Configuring Clients to Use ORMIS ............................................................................................ 15-22
Specify the Appropriate Java Naming Provider URL ...................................................... 15-22
Specify the Keystore and Password .................................................................................... 15-23
Enabling ORMI Tunneling through HTTPS ................................................................................. 15-23
xiii
Code Samples for Migration to JSSE .......................................................................................... 16-11
Additional Changes Relevant for Migration to JSSE ............................................................... 16-12
Features for Oracle Java SSL (Deprecated)..................................................................................... 16-13
Specifying Oracle Java SSL as the SSL Implementation for HTTPClient ............................. 16-13
OracleSSLCredential Class for Oracle Java SSL ....................................................................... 16-14
Security-Aware Applications Support in Oracle Java SSL...................................................... 16-14
Using HTTPClient with Oracle Java SSL................................................................................... 16-14
Sample Code (Oracle Java SSL) ........................................................................................... 16-14
Initializing SSL Credentials in Oracle Java SSL................................................................. 16-16
System Property Features with Oracle Java SSL ...................................................................... 16-16
Specifying Cipher Suites for Oracle Java SSL ........................................................................... 16-17
Property Oracle.ssl.defaultCipherSuites ............................................................................ 16-17
Method setSSLEnabledCipherSuites() ................................................................................ 16-17
SSL Cipher Suites Supported by Oracle Java SSL .................................................................... 16-17
xiv
Enabling and Configuring Subject Propagation for ORMI........................................................ 18-12
Overview of Subject Propagation in OC4J ................................................................................ 18-13
Enabling Subject Propagation for ORMI ................................................................................... 18-14
Set the Subject Propagation System Property.................................................................... 18-14
Enable JAAS Mode ................................................................................................................ 18-14
Grant RMI Permission for Subject Propagation ................................................................ 18-14
Sharing Principal Classes for Subject Propagation .................................................................. 18-15
Removing and Configuring Subject Propagation Restrictions............................................... 18-15
xv
Realm Issues....................................................................................................................................... A-4
Realm Names Omitted from User Names.............................................................................. A-4
Specifying Default Realm to Solve Authentication Failure ................................................. A-5
Logging...................................................................................................................................................... A-5
Using Oracle Diagnostic Logging with the OracleAS JAAS Provider ...................................... A-5
Using Standard JDK Logging with the OracleAS JAAS Provider Admintool......................... A-6
xvi
Granting and Revoking Permissions............................................................................................ C-14
Granting and Revoking Roles ....................................................................................................... C-14
Listing Login Modules ................................................................................................................... C-15
Listing Permissions ......................................................................................................................... C-15
Listing Realms ................................................................................................................................. C-16
Listing Roles..................................................................................................................................... C-16
Listing Users .................................................................................................................................... C-16
Converting from the principals.xml File to JAAS ...................................................................... C-17
xvii
<realm-name>.................................................................................................................................. D-19
<role> ................................................................................................................................................ D-20
<roles> .............................................................................................................................................. D-20
<type> ............................................................................................................................................... D-20
<type> ............................................................................................................................................... D-21
<url>.................................................................................................................................................. D-21
<user> ............................................................................................................................................... D-21
<users>.............................................................................................................................................. D-22
<value> ............................................................................................................................................. D-22
Index
xviii
xix
List of Examples
9–1 Example jazn-loginconfig element ........................................................................................ 9-21
10–1 Sample LDIF Defining a User and Role ............................................................................. 10-11
10–2 JAAS Login Module Configuration Corresponding to Example 10–1........................... 10-11
15–1 HTTPS Communication with Client Authentication.......................................................... 15-9
16–1 Using JSSE with HTTPClient ................................................................................................. 16-7
20–1 Extending AbstractPrincipalMapping ................................................................................ 20-14
xx
List of Figures
1–1 Access Control Approach Versus Capability Approach....................................................... 1-2
1–2 Role-Based Access Control ........................................................................................................ 1-3
2–1 Protection Domains ................................................................................................................. 2-10
2–2 Login Modules.......................................................................................................................... 2-14
2–3 Code Stack for doAs() and doAsPrivileged() Methods...................................................... 2-16
3–1 OC4J Security Architecture........................................................................................................ 3-5
7–1 Operation: Invoke .................................................................................................................... 7-19
7–2 Search and Select: MBean ....................................................................................................... 7-19
8–1 Oracle Single Sign-On and J2EE Environments ..................................................................... 8-4
8–2 Global JAZNContext Subtree................................................................................................. 8-16
8–3 Identity Management Realm JAZNContext Subtree .......................................................... 8-17
8–4 Simplified Directory Information Tree for the Identity Management Realm................. 8-17
11–1 Oracle Access Manager Architecture .................................................................................... 11-5
12–1 User and Role API Framework Model.................................................................................. 12-3
13–1 Identity Management Framework Data Flow ..................................................................... 13-3
14–1 Java SSO Internal Logic Flow................................................................................................. 14-4
14–2 Java SSO Runtime Operations ............................................................................................... 14-5
15–1 Oracle Component Integration in SSL-Enabled J2EE Environments ............................... 15-2
18–1 End-to-End Security Role Configuration ............................................................................. 18-2
18–2 Security Role References ......................................................................................................... 18-3
18–3 Subject Propagation ............................................................................................................... 18-13
20–1 Flow Chart of Choices for OC4J Container-Managed Sign-On ........................................ 20-4
20–2 Component-Managed Sign-On.............................................................................................. 20-6
20–3 Container-Managed Sign-On ................................................................................................. 20-8
C–1 Admintool Shell Directory Structure ...................................................................................... C-7
C–2 Sample Shell Directory Structure ............................................................................................ C-8
xxi
List of Tables
2–1 Java Permission Instance Characteristics ............................................................................... 2-9
3–1 JAAS Framework Features ....................................................................................................... 3-3
4–1 Configuration Repositories and Preferred Management Tools ....................................... 4-15
5–1 OracleAS JAAS Provider Permission Classes........................................................................ 5-8
5–2 System Properties for the JACC Provider ........................................................................... 5-20
7–1 OracleAS JAAS Provider Migration Tool Options............................................................. 7-14
7–2 JAZNMigrationTool Constants............................................................................................. 7-15
8–1 Key ssoreg Options ................................................................................................................. 8-10
8–2 LDAP SSL Properties and Related Properties .................................................................... 8-21
8–3 LDAP Connection Properties................................................................................................ 8-22
8–4 LDAP JNDI Connection Pool Properties............................................................................. 8-22
8–5 LDAP Cache Properties ......................................................................................................... 8-23
9–1 Login Modules Supplied with OC4J ....................................................................................... 9-3
9–2 RealmLoginModule Options.................................................................................................... 9-4
9–3 DBTableOraDataSourceLoginModule Options..................................................................... 9-6
9–4 DataSourceUserManager Properties.................................................................................... 9-11
9–5 Login Module Control Flags ................................................................................................. 9-17
10–1 Application Server Control External LDAP Provider Options........................................ 10-4
10–2 Application Server Control External LDAP Connection Pool Options .......................... 10-4
10–3 Application Server Control External LDAP User Options ............................................... 10-5
10–4 Application Server Control External LDAP Role and Member Options........................ 10-5
10–5 External LDAP Provider Options......................................................................................... 10-7
10–6 External LDAP User Options ................................................................................................ 10-7
10–7 External LDAP Role and Member Options......................................................................... 10-7
11–1 Oracle Access Manager Login Module Options............................................................... 11-19
11–2 Oracle Access Manager Troubleshooting.......................................................................... 11-33
13–1 Identity Management Framework Properties .................................................................. 13-13
14–1 Java SSO Properties .............................................................................................................. 14-12
16–1 Cipher Suites Supported by Oracle Java SSL.................................................................... 16-18
17–1 Values for auth-method in web.xml..................................................................................... 17-2
19–1 EJB Server Security Properties .............................................................................................. 19-1
19–2 EJB Client Security Properties ............................................................................................... 19-4
20–1 Properties for Declarative Container-Managed Sign-On................................................ 20-11
20–2 Method Descriptions for PrincipalMapping Interface .................................................... 20-13
20–3 Method Descriptions for AbstractPrincipalMapping Class ........................................... 20-14
D–1 <jazn> Attributes ...................................................................................................................... D-2
D–2 <property> Attributes .............................................................................................................. D-4
D–3 <credentials> Attributes .......................................................................................................... D-8
D–4 <jazn-data> Attributes ........................................................................................................... D-11
D–5 <user> Attributes .................................................................................................................... D-21
xxii
Preface
This manual discusses Oracle Containers for J2EE (OC4J) security features.
This preface contains these topics:
■ Audience
■ Documentation Accessibility
■ Related Documentation
■ Conventions
Audience
This manual is intended for experienced Java developers, deployers, and application
managers who want to understand the security features of OC4J. It discusses the
Oracle Application Server Java Authentication and Authorization Service (JAAS)
Provider in detail, as well as discussing security implications of individual J2EE
features, including Web applications, Enterprise JavaBeans (EJBs), the J2EE Connector
Architecture, Secure Sockets Layer, and the Common Secure Interoperability Version 2
protocol (CSIv2).
Documentation Accessibility
Our goal is to make Oracle products, services, and supporting documentation
accessible, with good usability, to the disabled community. To that end, our
documentation includes features that make information available to users of assistive
technology. This documentation is available in HTML format, and contains markup to
facilitate access by the disabled community. Accessibility standards will continue to
evolve over time, and Oracle is actively engaged with other market-leading
technology vendors to address technical obstacles so that our documentation can be
accessible to all of our customers. For more information, visit the Oracle Accessibility
Program Web site at
http://www.oracle.com/accessibility/
xxiii
Accessibility of Links to External Web Sites in Documentation
This documentation may contain links to Web sites of other companies or
organizations that Oracle does not own or control. Oracle neither evaluates nor makes
any representations regarding the accessibility of these Web sites.
Related Documentation
For more information, see the following Oracle resources.
Additional OC4J documents:
■ Oracle Containers for J2EE Developer’s Guide
This discusses items of general interest to developers writing an application to run
on OC4J—issues that are not specific to a particular container such as the servlet,
EJB, or JSP container. (An example is class loading.)
■ Oracle Containers for J2EE Deployment Guide
This covers information and procedures for deploying an application to an OC4J
environment. This includes discussion of the deployment plan editor that comes
with Oracle Enterprise Manager 10g.
■ Oracle Containers for J2EE Configuration and Administration Guide
This discusses how to configure and administer applications for OC4J, including
use of the Oracle Enterprise Manager 10g Application Server Control Console, use
of standards-compliant MBeans provided with OC4J, and, where appropriate,
direct use of OC4J-specific XML configuration files.
■ Oracle Containers for J2EE Services Guide
This provides information about standards-based Java services supplied with
OC4J, such as JTA, JNDI, JMS, the Oracle Application Server Java Object Cache,
and the XML Query Service.
■ Oracle Containers for J2EE Resource Adapter Administrator’s Guide
This provides information about resource adapters and the J2EE Connector
Architecture.
■ Oracle Containers for J2EE Servlet Developer’s Guide
This provides information for servlet developers regarding use of servlets and the
servlet container in OC4J, including basic servlet development and use of JDBC
and EJBs.
■ Oracle Containers for J2EE Support for JavaServer Pages Developer’s Guide
This provides information about JavaServer Pages development and the JSP
implementation and container in OC4J. This includes discussion of Oracle features
such as the command-line translator and OC4J-specific configuration parameters.
■ Oracle Containers for J2EE JSP Tag Libraries and Utilities Reference
This provides conceptual information as well as detailed syntax and usage
information for tag libraries and JavaBeans provided with OC4J.
xxiv
■ Oracle Containers for J2EE Enterprise JavaBeans Developer’s Guide
This provides information about Enterprise JavaBeans development and the EJB
implementation and container in OC4J.
■ Oracle Application Server Web Services Developer’s Guide
This describes Web services development and configuration in OC4J and Oracle
Application Server.
■ Oracle Application Server Advanced Web Services Developer’s Guide
This book describes topics beyond basic Web service assembly. For example, it
describes how to diagnose common interoperability problems, how to enable Web
service management features (such as reliability, auditing, and logging), and how
to use custom serialization of Java value types.
■ Oracle Application Server Web Services Security Guide
This describes Web services security and configuration in OC4J and Oracle
Application Server.
Related Javadoc sets:
■ Oracle Containers for J2EE Security Java API Reference
Documents APIs of the OracleAS JAAS Provider, identity management
framework, and Java SSO.
■ Oracle Containers for J2EE User and Role Java API Reference
Documents APIs for accessing user and role information from identity
management repositories.
■ Oracle Application Server HTTPClient Java API Reference
Documents APIs of the Oracle HTTPClient packages.
From the Oracle Application Server core documentation group:
■ Oracle Application Server Administrator’s Guide
■ Oracle Application Server Enterprise Deployment Guide
■ Oracle HTTP Server Administrator’s Guide
■ Oracle Process Manager and Notification Server Administrator’s Guide
■ Oracle Application Server Certificate Authority Administrator’s Guide
■ Oracle Application Server Best Practices
For Oracle Identity Management, Oracle Internet Directory, and Oracle Single
Sign-On:
■ Oracle Identity Management Infrastructure Administrator’s Guide
■ Oracle Identity Management Integration Guide
■ Oracle Identity Management Guide to Delegated Administration
■ Oracle Identity Management Application Developer’s Guide
■ Oracle Internet Directory Administrator’s Guide
■ Oracle Internet Directory API Reference
■ Oracle Application Server Single Sign-On Administrator’s Guide
For Oracle Access Manager:
xxv
■ Oracle Access Manager Introduction
■ Oracle Access Manager Installation Guide
■ Oracle Access Manager System Administration Guide
■ Oracle Access Manager Identity and Common Administration Guide
■ Oracle Access Manager Developer Guide
■ Oracle Access Manager Deployment Guide
For additional information, see:
■ Top-level link for Oracle documentation from the Oracle Technology Network:
http://www.oracle.com/technology/documentation/index.html
■ The Sun Java and J2EE Web pages, especially the Java Authentication and
Authorization Service (JAAS) Web site at :
http://java.sun.com/products/jaas/overview.html
Conventions
The following text conventions are used in this document:
Convention Meaning
boldface Boldface type indicates graphical user interface elements associated
with an action.
italic Italic type indicates book titles, emphasis, terms defined in text, or
placeholder variables for which you supply particular values.
monospace Monospace type within a paragraph indicates commands, URLs, Java
class names and method names, file and directory names, text that
appears on the screen, or text that you enter.
xxvi
What’s New
xxvii
– Group class: Use standard JAAS APIs instead.
■ The XMLUserManager class and its data store, principals.xml, are
deprecated. They will no longer be supported in the 11g release. For instructions
on migration, see "Migrating Principals from the principals.xml File" on page 7-16.
xxviii
■ The default setting of the jaas.username.simple property is now "true"; in
the 10.1.2 implementation, the default setting was "false". This now means that
by default, realm names are omitted from the names of authenticated principals
returned by such methods as getUserPrincipal() and getRemoteUser() for
servlets, and getCallerPrincipal() for EJBs.
■ There have been some OC4J account name changes: the admin account is now
oc4jadmin; the administrators role is now oc4j-administrators; the
jmx-users role is now oc4j-app-administrators. For the file-based
provider in standalone OC4J, oc4jadmin is initially deactivated. See "Predefined
Accounts" on page 4-11.
■ Required OC4J accounts are created automatically in Oracle Internet Directory
when you associate an OC4J instance with an OID instance. See "Required
Accounts Created in Oracle Internet Directory" on page 8-7.
■ Setting LD_LIBRARY_PATH is no longer necessary in 10.1.3.x implementations.
■ The jazn.debug.log.enable flag is no longer supported for logging. Use
regular OC4J logging features. See "Logging" on page A-5.
xxix
xxx
1
Basic Security Concepts
Application-Level Security
Application-level security determines who can access an application or its data, and
what tasks they can perform. The following topics discuss key areas of functionality:
■ About Authentication
■ About Authorization
About Authentication
Authentication deals with the question "Who is trying to access services?" In any system
and application it is paramount to ensure that the identity of the entity or caller trying
to access your application is identified in a secure manner. In a multitier application,
the entity or caller can be a human user, a business application, a host, or one entity
acting on behalf of (or impersonating) another entity.
Authentication information, such as user names and passwords, is stored in a user
repository, such as an XML file, database, or directory service. When a subject attempts
to access a J2EE application, such as by logging in, it is the role of a security provider to
look up the subject in the user repository and verify the subject’s identity. A security
provider is a module that provides an implementation of a specific security service
such as authentication or authorization. The Oracle Internet Directory is an example of
a user repository.
Although each J2EE application determines which user can access it, it is the security
provider that authenticates the user’s identity through the user repository.
About Authorization
Authorization regards the question "Who can perform tasks on which resources offered
by which components?" In a J2EE application, resources are typically expressed in
terms of URL patterns for Web applications, and method permissions for EJBs.
Authorization is on a per-role basis, with appropriate permissions being assigned to
each defined role in an application.
The following sections discuss types of authorization, or access control, and related
topics:
■ Access Control Lists and the Capability Model of Access Control
■ Role-Based Access Control
The capability and role-based models are complementary and often used together.
Access Control
Approach
File 1 File 2
When a user's responsibilities change (for example, through a promotion), the user's
authorization information is easily updated by assigning a different role to the user,
instead of by updating all access control lists containing entries for that individual
user.
For example, if multiple users no longer require write permissions on a file named
salaries in the /home/user directory, those privileges are removed from the HR
role. All members of the HR role then have their permissions and privileges
automatically updated.
A role can also be granted to another role, thus forming a role hierarchy that provides
administrators with a tool to model enterprise security policies.
See Also:
■ "Overview of Security Role Mapping" on page 3-8
Transport-Level Security
Independent of the previously discussed features for authentication and authorization
are features for making data secure as it is transmitted. This section provides an
overview of features intended to ensure that data transmitted over a network or the
Internet cannot be intercepted and read or altered by a third party. OC4J supports
secure communications using the HTTP protocol over the Secure Sockets Layer.
The following related topics are discussed here:
■ Secure Sockets Layer and HTTPS
■ SSL Authentication
■ X.509 Certificates
SSL Authentication
With SSL communication, any of the following authentication scenarios are possible:
■ No SSL authentication (or null authentication): The server does not send a
certificate and does not request a certificate from the client. From an SSL
perspective, the server does not know who the remote client is, or accepts any
certificate that may be presented by the client.
■ One-way SSL authentication: Either the server or the client, but not both, requires
certificates. "Server authentication", for example, is one-way authentication where
the server sends its certificate to the client but does not request a certificate from
the client. Alternatively, the server may require a certificate, but does not send one
and the client does not require one.
■ Two-way SSL authentication: This is "client and server authentication", where the
server sends a certificate, required by the client, and also requires the client to send
a certificate.
Configuring SSL authentication in the server is independent of configuring SSL
authentication in the client.
X.509 Certificates
Applications need to transmit authentication and authorization information over the
network. A digital certificate, as specified by the X.509 v3 standard, contains data
establishing a principal’s authentication and authorization information. A certificate
contains:
■ A public key, which is used in public key infrastructure (PKI) operations
■ Identity information (for example, name, company, and country)
■ Optional digital rights, which grant privileges to the owner of the certificate
Each certificate is digitally signed by a trust point. The trust point signing the certificate
can be a certificate authority (CA) such as VeriSign, a corporation, or an individual.
signer of certificate, and so on, is a certificate chain. The highest certificate in the chain
(the original signer) is called the root certificate of the certificate chain.
The root certificate is often on the approved list of the receiving process. Certificates in
the approved list are considered to be trusted certificates. A root certificate can be
signed by a CA or can be self-signed, meaning that the digital signature that verifies the
root certificate is encrypted through the private key that corresponds with the public
key that the certificate contains, rather than through the private key of a higher CA.
(Note that certificates of the CAs themselves are always self-signed.)
Functionally, a certificate acts as a container for public keys and associated signatures.
A single certificate file can contain one or multiple chained certificates, up to an entire
chain. Private keys are normally kept separately to prevent them from being
inadvertently revealed, although they can be included in a separate section of the
certificate file for convenient portability between applications.
A keystore is used to store certificates, including the certificates of all trusted parties, for
use by a program. Through its keystore, an entity such as OC4J can authenticate other
parties as well as authenticate itself to other parties. The keystore password is
obfuscated. Oracle HTTP Server has what is called a wallet for the same purpose. Sun's
SSL implementation introduces the notion of a truststore, which is a keystore file that
includes the trusted certificate authorities that a client will implicitly accept during an
SSL handshake.
In Java, a keystore is a java.security.KeyStore instance that you can create and
manipulate using the keytool utility that is provided with the Sun Microsystems
JDK. The underlying physical manifestation of this object is a file.
This chapter provides an overview of standard security models that can be used with
Java and J2EE applications, covering the following topics:
■ J2EE Security Model
■ Java 2 Security Model
■ Java Authentication and Authorization Service
■ Security Considerations during Development
Note: The J2EE, Java 2, and JAAS security models are somewhat
independent of each other and can be used separately or in
combinations. Strategies are discussed in "Authorization Strategies"
on page 5-20.
See Also:
■ Oracle Application Server Best Practices (available post-release) for
information about best practices for security
Notes:
■ OC4J also supports several Oracle-specific single sign-on
authentication methods, as summarized in "Overview of Oracle
Application Server Single Sign-On Alternatives" on page 3-6.
■ For either the file-based provider or Oracle Identity Management,
if you are not using single sign-on, we recommend digest
authentication as a more secure solution than basic authentication.
See Also:
■ "Specifying the Authentication Method (auth-method)" on
page 17-1
<web-resource-name>resource access</web-resource-name>
<url-pattern>/resource</url-pattern>
</web-resource-collection>
This is part of a security constraint in web.xml that also specifies the J2EE logical role
that is allowed to access the resource. J2EE logical roles, discussed in the J2EE
specification, include developers (application component providers), assemblers,
deployers, and system administrators.
For example, assume the J2EE role sr_developers is declared in the web.xml file.
The security constraint to allow this role to access the resource would look like this:
<security-constraint>
<web-resource-collection>
<web-resource-name>resource access</web-resource-name>
<url-pattern>/resource</url-pattern>
</web-resource-collection>
<!-- authorization -->
<auth-constraint>
<role-name>sr_developers</role-name>
</auth-constraint>
</security-constraint>
The sr_developers role can then be mapped to the appropriate deployment role (a
role defined in the security provider) in a later OC4J-specific configuration step.
See Also:
■ "Overview of Security Role Mapping" on page 3-8
■ For details, "Web Application Security Role and Constraint
Configuration" on page 17-6
The Web container propagates the security identity for any call from a servlet to the
EJB layer, in terms of the role specified in the <run-as> element, which must be a role
previously declared through a <security-role> element. The run-as identity hides
the propagated identity.
See Also:
■ "Identity Propagation" on page 2-7
■ "Specifying a Run-As Security Identity for a Web Application" on
page 17-8
Notes:
■ APIs documented here can be used with either the file-based
provider or Oracle Internet Directory as the user repository.
■ The com.evermind.security.User and Group classes from
previous releases are deprecated. (They will not be supported in
the 11g release.) Use standard JAAS APIs and signatures instead,
such as for getUserPrincipal(), utilizing populated subjects
as appropriate.
See Also:
■ "Principals and Subjects" on page 2-12 for a general discussion of
principals
■ Oracle Containers for J2EE Security Java API Reference (Javadoc)
EJB Authentication
An EJB being accessed in a remote container requires authentication of the client that is
accessing it:
■ A standalone Java client can pass credentials through user and password settings
in the jndi.properties file.
■ An EJB or Web client can pass credentials through a
javax.naming.InitialContext instance, which is created to look up the
remote EJB.
In addition, where ORMIS is used (ORMI in conjunction with the Secure Sockets
Layer), you can use client-cert authentication with EJBs.
See Also:
■ "Specifying Credentials in EJB Clients" on page 18-9
■ Chapter 15, "SSL Communication with OC4J" (particularly
"Requesting Client Authentication" on page 15-15 and "Enabling
ORMIS for OC4J" on page 15-18)
This is part of a method permission in ejb-jar.xml that also specifies the J2EE
logical role that is allowed to access the resource. J2EE logical roles, discussed in the
J2EE specification, include developers (application component providers), assemblers,
deployers, and system administrators.
The following excerpt allows the role myMgr to access any method in the
PurchaseOrder EJB:
<method-permission>
<role-name>myMgr</role-name>
<method>
<ejb-name>PurchaseOrder</ejb-name>
<method-name>*</method-name>
</method>
</method-permission>
The myMgr role can then be mapped to the appropriate deployment role (a role
defined in the security provider) in a later OC4J-specific configuration step.
See Also:
■ "Overview of Security Role Mapping" on page 3-8
■ For details, "Specifying J2EE Roles and Method Permissions in the
EJB Deployment Descriptor" on page 18-3
See Also:
■ "Identity Propagation" on page 2-7
■ "Specifying a Run-As or Caller Security Identity for an EJB" on
page 18-6
Notes:
■ APIs documented here can be used with either the file-based
provider or Oracle Internet Directory as the user repository.
■ The com.evermind.security.User class from previous
releases is deprecated. (It will not be supported in the 11g release.)
Use standard JAAS APIs instead, utilizing populated subjects as
appropriate.
See Also:
■ "Principals and Subjects" on page 2-12 for a general discussion of
principals
Identity Propagation
Identity propagation in J2EE refers to the forwarding of a security identity from a Web
module or EJB to an EJB that the original Web module or EJB invokes:
1. An initiating application client or Web client uses a security identity to access an
intermediate EJB or Web module.
2. The intermediate EJB or Web module invokes a target EJB by forwarding, or
propagating, a security identity to access the target EJB.
There are typically two models for propagation:
■ If the target container trusts the intermediate container, the caller identity of the
intermediate EJB or Web module can be propagated to the target EJB.
■ If the target container expects access by a particular identity, that identity can be
propagated to the target EJB.
In general, the target container must trust the intermediate container, because no data
is made available for the target container to use in authenticating the propagated
identity. Because the propagated identity will presumably be used for authorization
checks, such as isCallerInRole(), it is critical for the propagated identity to be
authentic.
In OC4J, identity propagation is referred to as subject propagation.
See Also:
■ "Enabling and Configuring Subject Propagation for ORMI" on
page 18-12
■ The following tutorial for additional information:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/Securit
y11.html
■ Security Permissions
■ Protection Domains
■ Java 2 Authorization: Java 2 Security Policies
■ Java 2 Authorization: Security Managers and Access Controllers
See Also:
■ For a tutorial on Java 2 Security:
http://java.sun.com/docs/books/tutorial/security/index
.html
Code-Based Security
Code-based security restricts the operations that applications can perform, by applying
sets of permissions to executing code. This protects against the actions of untrusted or
possibly malicious code, and could be to accomplish any of the following, for example:
■ Restrict database access to only trusted applications
■ Disallow the execution of code downloaded from the Internet
■ Limit operations that can be performed by third-party code
Code-based security differs from role-based security in that it is not based on users or
user roles. Permissions are granted based on code characteristics, such as where the
code is coming from and whether it is digitally signed (and by whom).
A codebase is a URL indicating code location, such as the following examples:
■ file: (any file on the local file system)
■ http://*.oracle.com (any file on any host at oracle.com)
■ file:${j2ee.home}/lib/oc4j-internal.jar
A codesource expands this concept to optionally include an array of certificates (stored
in a Java keystore) to verify signed code originating from the location. A codesource is
represented by a java.security.CodeSource instance, which is constructed by
specifying a java.net.URL instance and an array of
java.security.cert.Certificate instances.
The standard CodeSource class includes the following methods:
■ Certificate[] getCertificates()
Returns an array of the certificates associated with this codesource.
■ URL getLocation()
Returns the URL location associated with this codesource.
■ boolean equals(Object)
Compares the specified object (presumably a codesource object) with this
codesource object for equality. Two codesources are considered equal if their
locations are identical and they have the same set of certificates (though it is not
necessary for the certificates to be in the same order).
■ boolean implies(CodeSource)
See Also:
■ For information about the CodeSource class (and other standard
classes):
http://java.sun.com/j2se/1.4.2/docs/api/
Security Permissions
Permissions are the basis of the Java 2 Security Model. All Java classes (whether run
locally or downloaded remotely) are subject to a configured security policy that
defines the set of permissions available for those classes. Each permission represents a
specific access to a particular resource.
The java.security.Permission class is an abstract class that represents access to
a given resource, and optionally a specified action on that resource. A key method of
this class is implies(Permission permission), which checks whether the
actions of the specified permission are implied by the actions of the permission
instance upon which the method is called.
Here are common types of permissions and the classes that represent them (all
extending Permission, either directly or indirectly):
■ java.security.AllPermission
■ java.lang.RuntimePermission (includes only a resource target)
■ java.io.FilePermission (includes a resource and actions)
Table 2–1 identifies characteristics of a Java permission instance.
Protection Domains
A protection domain associates permissions with codesources (defined in "Code-Based
Security" on page 2-8). The policy currently in effect is what determines protection
domains. In the default implementation of the Policy class, a protection domain is
one grant entry in the file.
Each Java class is associated with a protection domain when it is loaded. Specifically,
each class being loaded is associated with a java.security.ProtectionDomain
instance. The permissions granted to this protection domain may be statically bound
or dynamically determined when an access control check is performed. Each
protection domain is assigned a set of permissions based on a configured security
policy when the JVM is started.
A ProtectionDomain instance contains one or more codesources. It may also
contain a Principal array describing who is executing the code, a classloader
reference, and a permission set (java.security.PermissionCollection
instance) representing a collection of Permission objects.
Figure 2–1 shows an example of the relationship between code, protection domains,
and permission sets. In this example:
■ Protection Domain 1 associates the codesources e.jar, c.class, r.class, and
i.jar with Permission Set 1.
■ Protection Domain 2 associates the codesources s.class, u.jar, t.class, and
y.class with Permission Set 2.
■ The System Domain associates all JAR files in the classpath with Special
Permissions.
See Also:
■ "Principals and Subjects" on page 2-12 for a general discussion of
principals
■ ORACLE_HOME/j2ee/home/config/java2.policy
(When you start OC4J with a security manager, the file in this location contains the
relevant permissions.)
See Also:
■ "Specifying a Java 2 Security Manager and Policy File" on page 5-1
■ "Creating or Updating a Java 2 Policy File" on page 5-3
See Also:
■ For more information about security management and
comparison between security managers and access controllers:
http://java.sun.com/j2se/1.5.0/docs/guide/security/spe
c/security-spec.doc6.html
See Also:
■ JAAS documentation at the following Web site for more specific
discussions of key JAAS features:
http://java.sun.com/products/jaas/
See Also:
■ Chapter 9, "Login Modules"
particular application, and in what order the login modules should be invoked. The
Configuration class is extended to provide an appropriate implementation.
For each login module, a control flag setting in the login module configuration
determines whether that login module is "required", "requisite", "sufficient", or
"optional", with the meanings of these settings being according to standard
functionality of the Configuration class, as discussed in Table 9–5, " Login Module
Control Flags" on page 9-17.
A login configuration contains an ordered list of login modules specified by fully
qualified class names, along with control flag settings and any option settings
particular to each login module. Authentication proceeds down the module list in
order. (In OC4J, the order is determined by the order in which the login modules are
configured in the system-jazn-data.xml file.)
Overall authentication is governed by the individual login modules and their control
flag settings.
<permissions>
<permission>
<class>java.lang.RuntimePermission</class>
<name>setContextClassLoader</name>
</permission>
</permissions>
</grant>
See Also:
■ For the Admintool: "Granting and Revoking Permissions" on
page C-14
■ For the system-jazn-data.xml file: "The system-jazn-data.xml
File" on page 4-7 and "Policy Configuration in
system-jazn-data.xml" on page 5-15
permission types, and is also more fine-grained than the Java 2 model, given the
ability to authorize according to principals. For example, while J2EE security is
sufficient for general protection of a Web URL or EJB method, JAAS security
would be required to control who may access a file in the file system, or who may
access security policy, create a user, or change a password.
JAAS is also the only one of these models that supports customized
authentication, through custom login modules. In addition, you can authenticate
against multiple user repositories.
As appropriate and necessary, you can use any model or a combination of the models
within an application. All three models are fully supported in OC4J. It is advisable to
limit yourself to the J2EE authorization model whenever it meets your needs, given
that it is the least complicated to deploy and administer. You can extend your
application to use Java 2 or JAAS security depending on your needs for finer-grained
code-based or subject-based security.
See Also:
■ "Authorization Strategies" on page 5-20 for details on application
security strategies
See Also:
■ Oracle Application Server Best Practices (available post-release) for
information about best practices for security
This chapter introduces the Oracle Containers for J2EE (OC4J) security
implementation. This implementation allows developers to integrate authentication,
authorization, and delegation services with their applications.
The key component of this implementation is the Oracle Application Server Java
Authentication and Authorization Service (JAAS) Provider, which supports the JAAS
specification.
This chapter covers the following:
■ Introducing the OracleAS JAAS Provider and Security Providers
■ Introducing Authentication Features in the OC4J Environment
■ Introducing Authorization Features in the OC4J Environment
■ Overview of Security Role Mapping
■ Overview of General-Use Identity Management Frameworks and APIs
See Also:
■ Oracle Application Server Best Practices (available post-release) for
information about best practices for security
■ For Oracle Application Server general security information and
infrastructure, the 10.1.2 version of the Oracle Application Server
Security Guide, a document that is not part of the 10.1.3.x
documentation set but is available at the following location:
http://www.oracle.com/technology/documentation/appserv
er1012.html
Note: In earlier releases, the term "JAZN" was used to refer to the
OracleAS JAAS Provider. This term is no longer used in general, but
still appears in code (such as class and package names) and the
Admintool shell prompt.
See Also:
■ "Using Security Realms in OC4J" on page 6-3
■ "Realm Management for the LDAP-Based Provider" on page 8-15
Figure 3–1 shows how the supported security providers interact with the overall
security provider framework.
OC4J
User/Role Policy
Authentication Authorization Management Management
File-based LDAP-based
Provider Provider External LDAP Custom Oracle Access
(JAZN-XML) (JAZN-LDAP) Provider Provider Manager
See Also:
■ "Web Application Standard Authentication Methods" on page 2-2
See Also:
■ "Mapping Security Roles" on page 6-10
■ "Web Application Security Role and Constraint Configuration" on
page 17-6
■ "Authenticating and Authorizing EJB Applications" on page 18-1
Note that Java SSO, an alternative Java single sign-on solution that does not rely
on additional infrastructure required by other single sign-on products, is
implemented through the pluggable identity management framework. Java SSO is
discussed in Chapter 14, "OC4J Java Single Sign-On".
■ An identity management API framework for accessing user and role information
from disparate identity management repositories. This user and role API
framework allows applications to access identity information (users and roles) in a
uniform and portable manner regardless of the particular underlying identity
repository. The underlying repository could be an LDAP directory server such as
Oracle Internet Directory, Active Directory (from Microsoft), or Sun Java System
Directory Server (from Sun Microsystems), or could be a database, flat file, or
some other custom repository. Supported operations include searching, creating,
updating, or deleting users and roles.
To avoid confusion with the pluggable identity management framework discussed
in Chapter 13, which is independent, we refer to the identity management API
framework as the "user and role APIs" or "user and role API framework".
Chapter 12, "User and Role API Framework", describes how to use these APIs.
This chapter provides an overview of features and tools for security administration
and configuration in OC4J and Oracle Application Server, covering the following
topics:
■ General OC4J Deployment and Configuration Features
■ Tools for Oracle Application Server and OracleAS JAAS Provider
■ JMX and MBeans Administration
■ Overview of Configuration Files and Key Elements
■ OC4J System Application
■ Summary of OC4J Accounts
■ Summary of Configuration Repositories and Security Management Tools
See Also:
■ Oracle Containers for J2EE Deployment Guide and Oracle Containers
for J2EE Configuration and Administration Guide for general
information about OC4J deployment, configuration, and
administration
See Also:
■ "Summary of Configuration Repositories and Security
Management Tools" on page 4-15
Notes:
■ In standalone OC4J you also have the option of using the
command-line OC4J admin_client.jar tool, which operates
through the OC4J system application, to deploy and bind your
J2EE applications. Alternatively, if you use the Oracle JDeveloper
tool to develop your application, you can use it to deploy the
application and any resource adapters as well.
■ Whenever a configuration change is made using Application
Server Control or the OC4J security provider MBean, the
application must be restarted. Until the application is restarted, all
other operations of the security provider MBean are invalidated
and will return an error message.
See Also:
■ Oracle Application Server Administrator’s Guide for more
information about Application Server Control
■ Oracle Containers for J2EE Configuration and Administration Guide
for information about the admin_client.jar utility
■ "OC4J System Application" on page 4-10
When you use the Admintool for the file-based provider, by default it updates the
system-jazn-data.xml file in the ORACLE_HOME/j2ee/home/config directory.
See Also:
■ Appendix C, "OracleAS JAAS Provider Admintool Reference"
See Also:
■ Oracle Identity Management Guide to Delegated Administration
You can also manage features such as attribute uniqueness, plug-ins, garbage
collection, change logs, replication, query optimization, debug logging, and access
control lists.
See Also:
■ Oracle Internet Directory Administrator’s Guide for general
information about Oracle Directory Manager
See Also:
■ "Summary of Configuration Repositories and Security
Management Tools" on page 4-15
■ Reference appendix in the Oracle Containers for J2EE Developer’s
Guide for information about elements of the
orion-application.xml (and system-application.xml)
file
Notes:
■ In order to take effect, changes to orion-application.xml
require an application restart (if the changes were made through
Application Server Control or security provider MBean) or an
OC4J restart (if the changes were made manually).
■ If there is no <jazn> element in orion-application.xml, the
security provider settings defer to those of the instance-level
jazn.xml file (where the system-jazn-data.xml repository
and jazn.com default realm are the default settings).
See Also:
■ Appendix D, "OracleAS JAAS Provider Configuration Files" for
details about the hierarchy, elements, and attributes of this file
Notes:
■ If changes to system-jazn-data.xml are made through
Application Server Control or the security provider MBean, then
an OC4J restart is not required for the changes to take effect. A
restart is required, though, if changes are made manually (which
is not generally recommended).
■ In previous releases, system-jazn-data.xml was named
jazn-data.xml. For the file-based provider, you can still use a
file named jazn-data.xml to store user and role information,
but this file would be application-specific. See the next section,
"Application-Specific jazn-data.xml File (Optional)".
■ Settings in the system-jazn-data.xml file can be manipulated
using Application Server Control or the OracleAS JAAS Provider
Admintool.
■ Changes made to the system-jazn-data.xml file are visible to
all applications that use it.
■ The system-jazn-data.xml file contains accounts for
predefined OC4J users and roles. See "Predefined OC4J Accounts
in system-jazn-data.xml" on page 7-12.
■ White space in element settings is significant, such as the
differences between the following:
<name>scott</name>
<name>scott </name>
<name> scott</name>
<name> scott </name>
See Also:
■ "Supplying an Application-Specific jazn-data.xml File" on
page 7-11
■ Appendix D, "OracleAS JAAS Provider Configuration Files" for
details about the hierarchy, elements, and attributes of this file
Persistence mode for changes to the repository, described in the preceding section for
system-jazn-data.xml, also affects jazn-data.xml.
Notes:
■ Think of the application-specific jazn-data.xml file as a
repository, not as a configuration file.
■ White space in element settings is significant, such as the
differences between the following:
<name>scott</name>
<name>scott </name>
<name> scott</name>
<name> scott </name>
The jazn.xml file for the OC4J home instance, referred to as the bootstrap jazn.xml
file, is typically located in the ORACLE_HOME/j2ee/home/config directory. It is
read at OC4J startup and used by the OracleAS JAAS Provider runtime. Without a
valid jazn.xml file, the OracleAS JAAS Provider cannot begin running.
If you use Application Server Control to associate OC4J with an Oracle Internet
Directory instance in order to use the Oracle Identity Management security provider,
then the <jazn> element of the bootstrap jazn.xml file is updated appropriately for
the Oracle Internet Directory instance. For example:
<jazn provider="LDAP" location="ldap://myoid.oracle.com:389" default-realm="us" >
...
</jazn>
See Also:
■ Appendix D, "OracleAS JAAS Provider Configuration Files" for
details about the hierarchy, elements, and attributes of this file
You can optionally use a system property to specify an alternative location for the
bootstrap jazn.xml file. When the OracleAS JAAS Provider starts, it searches for
jazn.xml in the following order, stopping the search as soon as it finds one:
1. Location specified by the system property oracle.security.jazn.config
2. Location specified by the system property java.security.auth.policy
3. J2EE_HOME/config, where J2EE_HOME is specified by the system property
oracle.j2ee.home
4. ORACLE_HOME/j2ee/home/config, where ORACLE_HOME is specified by the
system property oracle.home (this is generally the same location as
J2EE_HOME/config)
5. ./config
See Also:
■ Oracle Containers for J2EE Configuration and Administration Guide
for information about the OC4J application hierarchy and the
system and default applications
Predefined Accounts
OC4J 10.1.3.x implementations include predefined "bootstrap" users and roles for
Oracle Internet Directory (when you use Oracle Identity Management) or the
file-based provider.
For the file-based provider, the accounts are predefined in the
system-jazn-data.xml file. For Oracle Internet Directory (OID), they are created
automatically as default accounts as part of the OC4J-OID association process.
The following predefined accounts are common to both providers:
■ oc4jadmin user (formerly admin)
This is the default administrator account. During the Oracle Application Server or
OC4J installation process, you must specify a password for this account. You can
then use this account to log in to the Application Server Control Console. This
account is also used by Application Server Control when it performs
administrative functions (through the OC4J system application).
In a cluster environment, the oc4jadmin name and password serve as
administrative credentials for the cluster. Because there is only one set of
administrative credentials for a cluster, by default each OC4J instance must have
an oc4jadmin account with the same password. For this reason, use caution
when changing the password for this account.
As a good practice, you may consider creating additional administrative accounts
rather than using oc4jadmin for day-to-day administrative activities.
See Also:
■ "Creating and Configuring a New Administrator Account" on
page 4-13
The following additional accounts are predefined for the file-based provider only:
■ anonymous user, initially deactivated
Activate anonymous directly in the system-jazn-data.xml file, by changing
the deactivated attribute of the <user> element from "true" to "false".
Unlike for oc4jadmin, there is no support in the OracleAS JAAS Provider
Admintool for activating anonymous.
■ users role, for EJB/RMI access
■ jtaadmin user, to allow transaction propagation over ORMI
Do not remove any of the accounts described in this section, or the administrative
functions of the OracleAS JAAS Provider will not work.
See Also:
■ The next section, "Activation of the oc4jadmin Account
(Standalone OC4J)"
■ Application Server Control online help topics: "About the
oc4jadmin User", "About Administrative Users and Roles" (for
additional information about the Application Server Control
roles), and "Best Practices When Defining Administration Users
and Roles".
■ When you run the OracleAS JAAS Provider Admintool with the
-activateadmin option
You also specify the password as part of this command:
% java -jar jazn.jar -activateadmin password
For the File-Based Provider or Oracle Identity Management If you use the file-based provider
or Oracle Identity Management as the security provider for SOA components, the
following steps are required to use a custom administrator account:
1. Create the new administrative user account.
2. Grant the new administrative user account the roles oc4j-administrators and
ascontrol_admin.
3. Optionally set the admin.user property to allow the OC4J system application to
use the new account, as discussed in "Configuring a New Administrator Account
for the System Application" on page 4-15. If you are not using
system-jazn-data.xml as your repository, then this step requires you to also
create your new administrator account in system-jazn-data.xml, for use by
the system application, and grant it the necessary administrator roles.
Notes:
■ For the file-based provider, use the Application Server Control
Console for user and role management, as detailed in
"Configuring the File-Based Provider in Application Server
Control" on page 7-2.
■ For Oracle Internet Directory, use the Oracle Delegated
Administration Services (DAS) for user and role management, as
detailed in the Oracle Identity Management Guide to Delegated
Administration.
For Other Security Providers If you use anything other than the file-based provider or
Oracle Identity Management as the security provider for SOA components, the
following steps are required to use a custom administrator account:
1. Create the new administrative user account, using the appropriate tool for the
security provider.
2. Create the administrator roles oc4j-administrators and ascontrol_admin,
using the appropriate tool, if you have not already created them. For an external
LDAP provider, these roles must be under the group search base configured for
the LDAP provider. (See Table 10–4, " Application Server Control External LDAP
Role and Member Options" on page 10-5 and Table 10–7, " External LDAP Role
and Member Options" on page 10-7 for information about the group search base.)
3. Grant the new administrative user account the roles oc4j-administrators and
ascontrol_admin, using the appropriate tool, if you have not already done so.
4. Create the additional administrator roles oc4j-app-administrators,
ascontrol_appadmin, and ascontrol_monitor. (These do not have to be
granted to the administrative user.)
5. If the administrator must access EJBs, grant the roles oc4j-administrators
and ascontrol_admin RMI permission "login", if you have not already done so.
You can use the OracleAS JAAS Provider Admintool for this, as in the following
example:
% java -jar jazn.jar -grantperm myrealm -role oc4j-administrators \
com.evermind.server.rmi.RMIPermission login
Be aware that although the roles are defined in the external LDAP provider, these
permission grants are stored in the system-jazn-data.xml file.
6. Optionally set the admin.user property to allow the OC4J system application to
use the new account, as discussed in the next section, "Configuring a New
Administrator Account for the System Application". This step requires you to also
create your new administrator account in system-jazn-data.xml, for use by
the system application, and grant it the necessary administrator roles.
See Also:
■ "Creating the Administrative User and Roles and Granting RMI
Permission" on page 10-9
(These steps assume the OC4J system application is configured to use the file-based
security provider, as should always be the case.)
The specified account will then be used for a variety of administrative functions,
including, for example, being used by Application Server Control to deploy and
undeploy applications.
Chapter 2, "Java Platform Security" provided an overview of three major Java security
models: J2EE role-based security, Java 2 code-based security, and JAAS subject-based
security.
This chapter shows how to use the authorization features with each of these models.
They can be used individually or in combinations. At the end of the chapter there is
discussion of how to choose between security models.
The following topics are covered:
■ Java 2 Security and Code-Based Policy Management
■ Authorization APIs, JAAS Mode, and JACC in the OC4J Environment
■ OracleAS JAAS Provider Policy Management
■ Authorization Coding and Configuration
■ Authorization Strategies
Notes:
■ Using a security manager is not typically necessary in OC4J.
Within an Oracle Application Server installation, OC4J
instances run by default with no security manager. If you
choose to install a security manager, there may be significant
performance impact. If you use a custom security manager,
ensure that it does not interfere with OC4J functions.
■ Assuming you use the default implementation of
AccessController (provided with the Sun JDK), a call to
AccessController.checkPermission(), discussed in
"Using the checkPermission() Method" on page 5-17, enforces
Java 2 security policy for your application regardless of
whether a security manager is enabled.
The permissions granted to particular classes by the default security manager are
determined by reading a policy file. The default policy file is supplied as part of the
J2SE. You can specify any desired policy file by setting the system property
java.security.policy to the full path of the desired file. The following example
starts OC4J with the default security manager and the policy file that is supplied with
OC4J:
% java -Doracle.home=$ORACLE_HOME -Djava.security.manager \
-Djava.security.policy=$ORACLE_HOME/j2ee/home/config/java2.policy \
-jar oc4j.jar
Notes:
■ Be aware that this java2.policy file includes permissions that
are required for OC4J to run with a security manager. If you use a
different policy file, make sure the same permissions are included
in that file.
■ A .policy file is for Java 2 (code-based) policies only. With the
OracleAS JAAS Provider, JAAS (subject-based) policies are
declared within the <jazn-policy> element of the
system-jazn-data.xml file, or in Oracle Internet Directory if
you are using the Oracle Identity Management security provider,
as discussed in "OracleAS JAAS Provider Policy Configuration"
on page 5-14.
See Also:
■ The following sections, "Using PrintingSecurityManager to
Determine Required Java 2 Permissions" and "Creating or
Updating a Java 2 Policy File", for related information
■ "Java 2 Authorization: Security Managers and Access
Controllers" on page 2-11 for an overview of security managers
Similarly, the following example grants all permissions to wssecurity.jar (for Web
services security functions):
/* grant the WSSecurity AllPermission */
grant codebase "file:${oracle.home}/webservices/lib/wssecurity.jar" {
permission java.security.AllPermission;
};
The following example grants specific permissions to all applications running in the
ORACLE_HOME/appdemo directory:
/* Assuming you are running your application demo in $ORACLE_HOME/appdemo/, */
/* Grant JAAS permissions to the demo to run JAAS APIs*/
grant codebase "file:/${oracle.home}/appdemo/-" {
permission oracle.security.jazn.JAZNPermission "getPolicy";
permission oracle.security.jazn.JAZNPermission "getRealmManager";
permission oracle.security.jazn.policy.AdminPermission;
}
You can grant additional permissions for your application code or for classes
generated by OC4J, as necessary, by manually creating additional entries in the
.policy file. (There is currently no tool for this.) The required permissions will
depend on the details of your application, and the required codebase will depend on
the details of your installation.
See Also:
■ For details about policy file syntax:
http://java.sun.com/j2se/1.5.0/docs/guide/security/Pol
icyFiles.html
See Also:
■ "Authorization Coding and Configuration" on page 5-16 for
related task-oriented steps and examples
■ For standard JAAS programming reference information:
http://java.sun.com/j2se/1.4.2/docs/guide/security/jaa
s/JAASRefGuide.html
■ Oracle Containers for J2EE Security Java API Reference for Javadoc
for the OracleAS JAAS Provider
Important:
■ Set jaas-mode in orion-application.xml only, not in
jazn.xml.
■ If you switch from the file-based provider to Oracle Identity
Management at any time for any application through Application
Server Control, the <jazn> element in
orion-application.xml for the application is replaced with
the following. Any previous <jazn> settings would be lost and
would have to be redone.
<jazn provider="LDAP" />
See Also:
■ "Java 2 Authorization: Security Managers and Access Controllers"
on page 2-11 for an introduction to access controllers and access
control contexts
■ "Configuring and Using JAAS Mode" on page 5-18
■ Realm getRealm(String)
This method returns a realm object for the specified realm name.
An instance of the oracle.security.jazn.realm.Realm class provides access to
the store of users and roles for the particular realm. In the realm package, user
management is defined by the UserManager interface and role management is
defined by the RoleManager interface. The Realm class includes the following
instance methods:
■ UserManager getUserManager()
This method returns a UserManager instance, which you can use to manage
users in this realm.
■ RoleManager getRoleManager()
This method returns a RoleManager instance, which you can use to manage roles
in this realm.
Use an oracle.security.jazn.realm.UserManager instance to manage (add,
retrieve, or remove) users in the realm. This interface includes the following method:
■ RealmUser getUser(String)
This method returns a user object, for the specified name of a user in the realm.
See Also:
■ Chapter 12, "User and Role API Framework" for information
about new user and role APIs that are available, and in future
releases will replace some of the APIs discussed here
See Also:
■ For information about these classes, the OracleAS JAAS Provider
Javadoc: Oracle Containers for J2EE Security Java API Reference
This method examines the current calling context, which includes the inherited
access control context of the current thread, and represents the context as a
java.security.AccessControlContext instance.
■ void checkPermission(Permission)
Given a java.security.Permission instance, this static method checks
whether the access request indicated by the permission should be allowed, and
throws an AccessControlException if it should be denied. This method uses
the default access control context.
Note that this method enables you to check against Java 2 policy (as applicable)
without a security manager enabled.
The java.security.AccessControlContext class includes the following
method:
■ void checkPermission(Permission)
This has the same functionality as the
AccessController.checkPermission() method, but is called on a particular
AccessControlContext instance to use that access control context. (You can
construct an AccessControlContext instance from an array of
ProtectionDomain instances.)
Note that this method enables you to check against Java 2 policy (as applicable)
without a security manager enabled.
The java.lang.SecurityManager class includes the following method:
■ void checkPermission(Permission)
This has the same functionality as the checkPermission() methods of the
AccessController and AccessControlContext classes, but is used with a
security manager in place, is called against the security manager instance, and
throws a SecurityException if access should be denied.
The javax.security.auth.Subject class includes the following method:
■ Subject getSubject(AccessControlContext)
This static method returns the subject that is associated with the specified access
control context. You can specify the default access control context as follows:
mysubject = Subject.getSubject(AccessController.getContext());
collection consists of permissions of a subject, this method tells you if the subject
has the specified permission, such as in the following example:
jaaspolicy = javax.security.auth.Policy.getPolicy();
jaaspolicy.getPermissions(mysubject,null).implies(perm);
See Also:
■ "Java 2 Authorization: Java 2 Security Policies" on page 2-10 for an
introduction to codesources
See Also:
■ "Enabling the Java Authorization Contract for Containers" on
page 5-19
■ For general information about JACC:
http://java.sun.com/j2ee/javaacc/
http://www.jcp.org/en/jsr/detail?id=115
See Also:
■ "Java 2 Security and Code-Based Policy Management" on page 5-1
regarding code-based policy
(RMI permission "login" is a permission you must often grant to allow EJB/RMI
access.)
To grant this same permission to the user JDOE_ENDUSER:
% java -jar jazn.jar -grantperm myrealm -user JDOE_ENDUSER \
com.evermind.server.rmi.RMIPermission login
To grant this permission to the LDAP principal hobbes (when using an external
LDAP provider):
% java -jar jazn.jar -grantperm oracle.security.jazn.realm.LDAPPrincipal hobbes \
com.evermind.server.rmi.RMIPermission login
To grant FilePermission for a file sample.txt for actions "read, write" to user
martha in realm foo:
% java -jar jazn.jar -grantperm foo -user martha java.io.FilePermission
sample.txt read,write
See Also:
■ "OracleAS JAAS Provider Policy Configuration" on page 5-14
regarding configuration resulting from permission grants
response.setContentType("text/html");
out.println("<HTML><BODY bgcolor=\"#FFFFFF\">");
out.println("Time stamp: " + new Date().toString());
out.println("request.isUserInRole('ar_developers') = " +
request.isUserInRole("ar_developers") + "<br>");
try {
//Grant Permissions to a user developer
out.println("</BODY>");
out.println("</HTML>");
}
See Also:
■ "OracleAS JAAS Provider Realm and Policy APIs" on page 5-6
■ "OracleAS JAAS Provider APIs for Granting or Revoking
Permissions" on page 5-7
■ "APIs for Checking Permissions" on page 5-9
■ The next section, "OracleAS JAAS Provider Policy
Configuration", regarding configuration resulting from
permission grants
To replace all security properties with the Oracle properties (note the two equals signs,
"=="):
-Djava.security.properties==ORACLE_HOME/j2ee/home/config/jazn.security.props
See Also:
■ Appendix B, "OracleAS JAAS Provider Samples" for the
complete example
response.setContentType("text/html");
out.println("<HTML><BODY bgcolor=\"#FFFFFF\">");
out.println("Time stamp: " + new Date().toString());
out.println("request.isUserInRole('ar_developers') = " +
request.isUserInRole("ar_developers") + "<br>");
out.println("</BODY>");
out.println("</HTML>");
}
See Also:
■ "Related Web Application APIs" on page 2-4
■ "Related EJB APIs" on page 2-6
Obtaining a Subject
To perform authorization in your code, you will often have to obtain a Subject
instance for the authenticated user who is attempting to access resources. You can
accomplish this through standard JAAS functionality, using the static
Subject.getSubject() method and specifying an access control context.
Typically, use the default access control context:
mysubject = Subject.getSubject(AccessController.getContext());
Alternatively, you can specify a particular access control context (such as one you have
constructed from a set of protection domains, for example):
mysubject = Subject.getSubject(acc);
Note that when you use JAAS mode, OC4J associates an authenticated subject and its
permissions with the default access control context and its permissions.
See Also:
■ "APIs for Checking Permissions" on page 5-9
■ "Configuring and Using JAAS Mode" on page 5-18
//create permission
FilePermission perm = new FilePermission("/home/developer/foo.txt","read");
//check permission
AccessController.checkPermission(perm);
In OC4J, any JAAS mode setting is relevant with respect to what the access control
context consists of when AccessController.checkPermission() is called, as
follows:
■ With no JAAS mode (jaas-mode="null"), checkPermission() enforces
code-based security based on the security policy in effect, as presumably specified
in a Java 2 policy file. There is no provision for subject-based security.
■ With doAs JAAS mode (jaas-mode="doas"), checkPermission() enforces a
combination of code-based and subject-based security according to the new access
control context created through the doAs() block within which OC4J executes
your application code. OC4J appends the permissions of the subject to the
permissions of the default access control context.
■ With doAsPrivileged JAAS mode (jaas-mode="doasprivileged"),
checkPermission() has the same functionality as in doAs mode, but OC4J uses
a null access control context, as specified when OC4J calls doAsPrivileged().
This is to use subject-based security only.
See Also:
■ "Introduction to JAAS Mode" on page 5-5
■ "APIs for Checking Permissions" on page 5-9
■ "JAAS Authorization: Subject Methods doAs() and
doAsPrivileged()" on page 2-15
The code follows, using two different ways to check permissions, for demonstration
purposes. Because of the JAAS mode setting, the action method, in this case doGet(),
will be executed by OC4J within a Subject.doAsPrivileged() block for the
authenticated subject.
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
ServletOutputStream out = response.getOutputStream();
response.setContentType("text/html");
out.println("<HTML><BODY bgcolor=\"#FFFFFF\">");
out.println("Time stamp: " + new Date().toString());
out.println("request.isUserInRole('ar_developers') = " +
request.isUserInRole("ar_developers") + "<br>");
//create Permission
FilePermission perm = new FilePermission("/home/developer/foo.txt","read");
{
// CHECK PERMISSION VIA ACCESS CONTROLLER
AccessController.checkPermission(perm);
javax.security.auth.Policy currPolicy =
javax.security.auth.Policy.getPolicy();
//Check Permissions
out.println("Policy.implies permission: "+ perm +" ? " +
currPolicy.getPermissions(Subject.getSubject(acc),null).implies(perm));
}
out.println("</BODY>");
out.println("</HTML>");
}
See Also:
■ "APIs for Checking Permissions" on page 5-9
See Also:
■ "Implementation of Java Authorization Contract for
Containers" on page 5-11 for an overview
Authorization Strategies
For each of the key Java security models discussed earlier—J2EE, Java 2, and
JAAS—this section summarizes when it may be advantageous to use it, and how it
works. Complete operational details are provided elsewhere in this manual (mostly
earlier in this chapter).
See Also:
■ "Security Considerations during Development" on page 2-17
How Is It Enforced?
J2EE security is enforced by the J2EE container (OC4J).
How Is It Enforced?
For Java 2 security policies to be enforced by an application server and the underlying
JDK, a security manager must be enabled.
For Java 2 security policies to be enforced within your application:
■ If you want the capability of code-based security in your application, but with an
administrator being able to control when the security checks are performed, you
can choose to enforce code-based security only when a security manager is
enabled. In this case, you can use the checkPermission() method of the
SecurityManager instance.
Be aware that for this scenario, the JVM must be started with a security manager
enabled.
■ If code-based security requirements in your application are independent of a
security manager, you can choose to enforce code-based security within your
application regardless of the presence of a security manager. In this case, you can
use the static AccessController.checkPermission() method to check
permissions.
In this scenario, it is important to note that the overall environment will not be
secure without a security manager. Other code in the environment, including JDK
classes, will not be running in a secure mode.
How Is It Enforced?
You can enforce JAAS security through the
AccessController.checkPermission() method or Policy.implies()
method.
If you are also using Java 2 security and have a security manager enabled, you can
alternatively use the SecurityManager.checkPermission() method.
(Also refer to earlier discussion regarding enforcement of Java 2 policy.)
This chapter discusses general tasks and related guidelines that apply across the
various security providers you can use with OC4J:
■ Tasks for Password Management
■ Using Security Realms in OC4J
■ Deployment Tasks for Security
■ Post-Deployment Tasks for Security
■ Tasks to Share a Library
See Also:
■ Oracle Application Server Best Practices (available post-release)
for information about best practices for security
■ The following Web site for OC4J "how-to" examples:
http://www.oracle.com/technology/tech/java/oc4j/1013
/how_to/index.html
In other OC4J configuration, you can avoid exposing password cleartext by using
password indirection, as explained in "Using Password Indirection" on page 6-1.
■ Precede the password with "!" (in which case "!" is not
considered part of the password):
<credentials>!welcome</credentials>
For Oracle Identity Management, the default realm is according to the Oracle Internet
Directory, where it is determined during Oracle Internet Directory installation. After
you associate OC4J with an Oracle Internet Directory instance, the default realm is
reflected at the OC4J instance level, such as in the following example:
<jazn provider="LDAP" location="ldap://www.example.com:636" default-realm="us"/>
"Using the Default Realm" on page 6-5 discusses guidelines to be aware of when you
use the default realm.
Important:
■ A default realm should always be specified, even if you use
only one realm. For the file-based provider, this means you
should specify a default realm when you configure your
security provider during application deployment.
■ Do not remove configuration of the jazn.com realm from
system-jazn-data.xml; it is there by default and must
remain there for use by the OC4J system application.
Important:
■ If you switch from the file-based provider to Oracle Identity
Management at any time for any application through
Application Server Control, the <jazn> element in
orion-application.xml for the application is replaced
with the following. Any prior settings within the <jazn>
element would be lost and would have to be redone.
<jazn provider="LDAP" />
See Also:
■ Oracle Containers for J2EE Deployment Guide for a full discussion of
deployment and related considerations
■ Map the security roles (including the application-specific roles, if they exist) to
users and roles defined by the OracleAS JAAS Provider. For example, the J2EE
role called hr_manager may be mapped to a given set of users defined by the
OracleAS JAAS Provider.
■ Consider whether you have any code that you will want to load as shared libraries
(login modules, for example).
Deploying an Application
This section discusses how to deploy an application, focusing on the functionality of
the Application Server Control Console.
See Also:
■ "Specifying the Security Provider through Application Server
Control" on page 6-9
■ "Specifying Security Role Mapping through Application Server
Control" on page 6-11
■ "Providing Login Modules as OC4J Shared Libraries" on page 9-15
4. Back in the Deploy: Deployment Settings page, choose Deploy to complete the
deployment, or choose another task, as desired. The list of tasks is noted in
"Deploying an Application through Application Server Control" on page 6-8.
See Also:
■ "Overview of Security Role Mapping" on page 3-8
■ "Web Application Security Role and Constraint Configuration"
on page 17-6
■ "Mapping J2EE Roles to Deployment Users and Roles" on
page 18-6
<security-role-ref>
<role-name>ar_developers</role-name>
<role-link>sr_developers</role-link>
</security-role-ref>
After these steps, mappings to deployment roles defined in the security provider (such
as in a jazn-data.xml file or the system-jazn-data.xml file for the file-based
security provider, or in Oracle Internet Directory for the LDAP-based provider) are
defined in the OC4J-specific descriptors—orion-web.xml, orion-ejb-jar.xml,
or orion-application.xml. These files are updated, as appropriate, through the
mappings you define when you deploy an application through Application Server
Control, and are reflected in <security-role-mapping> elements. These mappings
are discussed in the next two sections, "Specifying Security Role Mapping through
Application Server Control" and "Mapping J2EE Roles to Deployment Roles in OC4J
Configuration Files".
See Also: The preceding discussion leaves out some details that
differ between Web applications and EJBs. Refer to the following for
additional information:
■ "Web Application Security Role and Constraint Configuration" on
page 17-6
■ "Authenticating and Authorizing EJB Applications" on page 18-1
This association permits the developer role to access resources that are accessible to
the sr_developers role according to security constraints configured in the standard
deployment descriptors.
Consider a user john, for example, who is a member of the developer deployment
role. Because this role is mapped to the J2EE role sr_developers, john has access to
the application resources available to the sr_developers role.
Using the OC4J PUBLIC Role to Allow General Access by Authenticated Users
For situations where you care only about authentication, not authorization, OC4J
supports a mode where any authenticated user is allowed access to a given application
or resource. This is supported through the PUBLIC role, and can be configured down
to a per-URL or per-method basis as desired. This involves the following steps:
1. If you do not already have a J2EE logical role intended for public access, you can
define such a role in web.xml (for a Web application) or in ejb-jar.xml (for an
EJB).
For example, in web.xml:
<web-app>
...
<security-role>
<role-name>public_role</role-name>
</security-role>
...
<auth-constraint>
<role-name>public_role</role-name>
</auth-constraint>
...
</web-app>
Or, in ejb-jar.xml:
<assembly-descriptor>
...
<security-role>
<role-name>public_role</role-name>
</security-role>
...
<method-permission>
<role-name>public_role</role-name>
<method>method</method>
</method-permission>
...
</assembly-descriptor>
3. In the Security Providers page, under "Application Level Security", go to the Edit
task for your application.
This brings you to the Security Provider page, displaying information on the provider
for your application and allowing you to update settings or change to a different
security provider.
See Also:
■ Oracle Containers for J2EE Developer’s Guide for more information
about OC4J class loading and shared libraries
OC4J supplies a file-based security provider, where an XML-based file is used as the
repository for users, roles, and policies. Use of this file-based provider is typical during
development and in small production environments (such as when using standalone
OC4J), and is the default security provider. Specifically, OracleAS JAAS Provider
supports the following tasks for the file-based (XML-based) provider:
■ Create realms, users, and roles.
■ Grant roles to users and to other roles.
■ Assign permissions to specific users and roles (principals).
This information is stored in an XML repository, typically system-jazn-data.xml,
although you have the option of using an application-specific jazn-data.xml file
instead.
This chapter discusses basic user, role, and realm management tasks for the file-based
provider, focusing on features of the Application Server Control Console.
The chapter is divided into the following sections:
■ Tools for File-Based Provider Policy and Realm Management
■ Configuring the File-Based Provider in Application Server Control
■ File-Based Provider Settings in OC4J Configuration Files
■ OracleAS JAAS Provider Migration Tool
■ Migrating Principals from the principals.xml File
■ Using the File-Based Provider Across an OC4J Group
Notes:
■ Be aware that with the file-based provider, role comparisons for
authorization are case-sensitive.
■ By default, the file-based provider is the security provider, the
system-jazn-data.xml file is the repository, and jazn.com is
the default realm. The system-jazn-data.xml file is located in
the ORACLE_HOME/j2ee/instance_name/config directory.
Changes made to this repository are visible to all applications that
use it.
See Also:
■ "Creating a New Administrator Account" on page 4-13 if you
want to use an administrator account other than oc4jadmin
See Also:
■ Appendix C, "OracleAS JAAS Provider Admintool Reference"
Notes:
■ Procedures discussed throughout this section assume you are
logged in to Application Server Control as a user with required
administrative permissions (as oc4jadmin, for example).
■ Security provider settings, optionally including specification of
the repository file, affect settings in the <jazn> element of the
orion-application.xml file. Realm, user, and role settings
affect settings under the <jazn-realm> element in the repository
file.
See Also:
■ "File-Based Provider Settings in OC4J Configuration Files" on
page 7-9, for examples of the XML configuration that results from
the steps described in this section
Create a Realm
From the Security Provider page for your application, execute the following steps to
create a realm:
1. Choose the Realms tab.
2. Above the list of existing realms, choose Create.
3. In the resulting Add Realm page:
Delete a Realm
From the Security Provider page for your application, execute the following steps to
delete a realm:
1. In the list of existing realms, choose the Delete task for the realm you want to
delete.
2. In the resulting Confirmation page, choose Yes to delete the realm.
This takes you back to the Security Provider page.
Create a User
From the Security Provider page for your application, execute the following steps to
create a user:
1. Choose the Realms tab.
2. In the Realms page, under "Users" in the list of realms, and in the row for the
realm of interest, select the number that shows how many users are in the realm.
This is a link to the Users page for the realm.
3. In the Users page, above the list of existing users in the realm, choose Create.
4. In the resulting Add User page:
■ Specify the desired user name.
■ Specify and confirm the desired password for the user.
■ Under "Assign Roles", for any available role you want the user to belong to,
move the role name into the "Selected Roles" column.
■ Choose OK to add the user.
This takes you back to the Users page, where you can see the new user in the list of
users.
Note: Do not create user names that contain slash (/) characters, as
in a/b/c.
Delete a User
From the Security Provider page for your application, execute the following steps to
delete a user:
1. Choose the Realms tab.
2. In the Realms page, under "Users" in the list of realms, and in the row for the
realm of interest, select the number that shows how many users are in the realm.
This is a link to the Users page for the realm.
3. In the Users page, choose the Delete task for the user you want to delete.
4. In the resulting Confirmation page, choose Yes to delete the user.
This takes you back to the Users page.
Edit a User
From the Security Provider page for your application, execute the following steps to
edit the properties of a user:
1. Choose the Realms tab.
2. In the Realms page, under "Users" in the list of realms, and in the row for the
realm of interest, select the number that shows how many users are in the realm.
This is a link to the Users page for the realm.
3. In the Users page, select the user you want to edit.
4. In the resulting User page:
■ If you want to change the user password, enter the old password, then specify
and confirm the desired new password.
■ If you want to add the user to any roles or remove the user from any roles,
under "Assign Roles", move role names into or out of the "Selected Roles"
column as desired.
■ Choose Apply to edit the user.
This takes you back to the Users page.
Note: You can also reach the User page for a given user by
navigating from the Role page (see "Edit a Role" on page 7-8) for any
role that the user belongs to. In the Role page, under "Users", select the
user of interest.
Create a Role
From the Security Provider page for your application, execute the following steps to
create a role:
1. Choose the Realms tab.
2. In the Realms page, under "Roles" in the list of realms, and in the row for the realm
of interest, select the number that shows how many roles are in the realm. This is a
link to the Roles page for the realm.
3. In the Roles page, above the list of existing users in the realm, choose Create.
4. In the resulting Add Role page:
■ Specify the desired role name.
■ Choose the permissions you want to grant to the role (essentially, to users or
other entities belonging to the role)—RMI permission, administration
permission, neither, or both.
A user needs RMI (remote method invocation) permission to be able to access
objects on OC4J through RMI, such as from a remote EJB client.
A user needs administration permission to perform administrative functions
such as startup, shutdown, and configuration changes.
■ Under "Assign Roles", for any available role you want the new role to inherit
from, move the role name into the "Selected Roles" column.
Delete a Role
From the Security Provider page for your application, execute the following steps to
delete a role:
1. Choose the Realms tab.
2. In the Realms page, under "Roles" in the list of realms, and in the row for the realm
of interest, select the number that shows how many roles are in the realm. This is a
link to the Roles page for the realm.
3. In the Roles page, choose the Delete task for the role you want to delete.
4. In the resulting Confirmation page, choose Yes to delete the role.
This takes you back to the Roles page.
Edit a Role
From the Security Provider page for your application, execute the following steps to
edit the properties of a role:
1. Choose the Realms tab.
2. In the Realms page, under "Roles" in the list of realms, and in the row for the realm
of interest, select the number that shows how many roles are in the realm. This is a
link to the Roles page for the realm.
3. In the Roles page, select the role you want to edit.
4. In the resulting Role page:
■ Update permissions for the role as desired, by selecting or unselecting RMI
permission and administration permission.
■ Under "Assign Roles", move role names into or out of the "Selected Roles"
column, depending on which roles you want this role (the role you are
editing) to inherit from.
■ Choose Apply to edit the role.
This takes you back to the Roles page.
See Also:
■ "Edit a User" on page 7-6 for how to add a user to a role
You can administer the instance-level file-based provider in much the same was as you
would administer the file-based provider for an application. You can navigate to the
Application Server Control Console Instance Level Security page as follows:
1. From the OC4J Home page for the OC4J instance, choose the Administration tab.
2. In the Administration page, choose the Security Providers task (under "Security").
3. In the Security Providers page, choose Instance Level Security.
4. From the resulting Instance Level Security page, you can manage instance-level
realms, users, and roles using essentially the same steps as documented earlier in
this chapter, in "Managing Application Realms through Application Server
Control" on page 7-4, "Managing Application Users through Application Server
Control" on page 7-5, and "Managing Roles through Application Server Control"
on page 7-7.
Or, if the jazn.xml file has no location and default-realm settings, this
would use the default repository system-jazn-data.xml and the default realm
jazn.com.
■ Delegate to the instance-level jazn.xml file for the repository. If the <jazn>
element in jazn.xml has the setting provider="XML", then its setting for the
repository (location attribute) is used, but the orion-application.xml file
setting for the default-realm (default-realm attribute) is used, if
orion-application.xml has a <jazn> element such as the following:
<jazn provider="XML" default-realm="abc.com" />
Or, if the jazn.xml file has no location setting, this would use the default
repository system-jazn-data.xml.
■ Do not delegate; specify both the repository and the default realm in
orion-application.xml. In this example, orion-application.xml
specifies the repository jazn-data.xml and the default realm myrealm:
<jazn provider="XML" location="./jazn-data.xml" default-realm="myrealm" />
Notes: Note the following for situations where the application uses
the file-based provider (provider="XML" in
orion-application.xml) but the jazn.xml file has the setting
provider="LDAP":
■ If orion-application.xml specifies no repository file, then
system-jazn-data.xml will be the repository.
■ If orion-application.xml specifies no default realm, then
jazn.com file will be the default realm.
</member>
<member>
<type>user</type>
<name>JtaAdmin</name>
</member>
</members>
</role>
<role>
<name>oc4j-app-administrators</name>
<display-name>OC4J Application Administrators</display-name>
<description>OC4J application-level administrators</description>
<members>
</members>
</role>
<role>
<name>users</name>
<display-name>users</display-name>
<description>users role for rmi/ejb access</description>
<members>
</members>
</role>
</roles>
</realm>
</jazn-realm>
See Also:
■ "Predefined Accounts" on page 4-11 for additional information
about these accounts
■ "Activation of the oc4jadmin Account (Standalone OC4J)" on
page 4-12
Notes: Be aware of the following when you use the migration tool:
■ To migrate to Oracle Internet Directory, the directory server must
be running and available when you run the tool.
■ When output to an LDIF file is generated, passwords are in clear
text. It is your responsibility to take proper care in protecting this
information.
■ When migrating to Oracle Internet Directory, passwords may
have to be modified to conform to Oracle Internet Directory
requirements (such as having at least one numeric character).
■ When in policy mode or all mode: 1) When migrating permissions
for a non-realm custom principal, the JAR file containing the class
files for the custom principal must be available in the classpath. 2)
If you are migrating custom permissions, the JAR file containing
the class files for the custom permissions must be available in the
classpath.
■ The migration tool is not intended for migration of indirect
password accounts to Oracle Internet Directory.
■ Be aware of the possibility of conflict. Migrated users and roles
may already exist in the destination realm. When migrating to
Oracle Internet Directory, for example, commands such as
ldapmodify and bulkload can be used in conjunction with
standard JDK logging to obtain information that will help you to
recover from conflicts.
The following example migrates in all mode to the default subscriber realm in Oracle
Internet Directory on the specified host:
% java oracle.security.jazn.tools.JAZNMigrationTool -D cn=orcladmin -w welcome1 \
-h myhost.example.com -p 389 -sf /tmp/jazn-data.xml -df /tmp/dest.ldif \
-sr jazndemo.com
/**
* Perform the migration operation
*/
public void migrateData() throws JAZNException
The params parameter in the constructor supports the same options as described in
Table 7–1 in the preceding section, with the same defaults. Parameter keys are defined
as constants in the JAZNMigrationTool class. Table 7–2 shows the correlation
between constants defined in JAZNMigrationTool and command-line options.
The -convert option migrates the principals.xml file into the specified realm of
the current OracleAS JAAS Provider. The filename argument specifies the path
name of the input file (typically
ORACLE_HOME/j2ee/home/config/principals.xml).
The migration converts principals.xml users to deployment users and converts
principals.xml groups to deployment roles. All permissions that were previously
granted to a principals.xml group are mapped to the deployment role. Users that
were deactivated at the time of migration are not migrated. This ensures that no users
can inadvertently gain access through the migration.
Before you convert principals.xml, you must make sure that you have an
administrative user that is authorized to manage realms. To do this:
1. Activate the administrative user in principals.xml, which is deactivated by
default. Be sure to create a password for the administrator.
2. Create the realm principals.com with a dummy user and a dummy role. For
example, in the Admintool shell you would type:
JAZN> addrealm principals.com u1 welcome r1
Make sure that the administrator name you used to create the realm is different
from the name of the administrator in principals.xml. This is necessary
because the convert option does not migrate duplicate users, and migrates
duplicate roles by overwriting the old one.
3. Migrate principals.xml to the principals.com realm, as in:
% java -jar jazn.jar -convert config/principals.xml principals.com
Important: When you stop an OC4J instance, at least one other OC4J
instance must be running on the application server that hosts the
instances. If the check box to stop an OC4J instance is disabled, then
no other OC4J instances in that application server are running.
c. Choose Create.
Note: You can also move an OC4J instance into a group after the
group is created:
1. In the Cluster Topology page, under Groups, select the group.
2. In the Group: groupname page, in the OC4J Instances tab, choose Add.
3. In the Add OC4J Instances to Group page, select and add OC4J instances
to the group as desired.
See Also:
■ For additional information about OC4J group features, the topic
"Group OC4J Instances Page" in the Application Server Control
online help
Notes:
■ Be aware that with the LDAP-based provider, role comparisons
for authorization are not case-sensitive.
■ After you add or modify a user account in Oracle Internet
Directory, you should be able to log in without restarting OC4J,
assuming you have associated Oracle Internet Directory with
OC4J as described in "Associate Oracle Internet Directory with
OC4J" on page 8-5.
See Also:
■ For information about migrating from a file-based repository to an
Oracle Internet Directory repository, "OracleAS JAAS Provider
Migration Tool" on page 7-13
■ For information about user and role APIs that you can use with
Oracle Internet Directory, Chapter 12, "User and Role API
Framework"
■ "Creating a New Administrator Account" on page 4-13 if you
want to use an administrator account other than oc4jadmin.
See Also:
■ Oracle Identity Management Infrastructure Administrator’s Guide
■ Oracle Identity Management Application Developer’s Guide
See Also:
■ Oracle Internet Directory Administrator’s Guide
See Also:
■ Oracle Application Server Single Sign-On Administrator’s Guide
■ Oracle Identity Management Application Developer’s Guide
(particularly the chapter on developing applications for single
sign-on)
HTTP
Client OC4J
HTTP Apache JServ
Protocol WebApp A1
mod_oc4j
Java Plug-in
servlet servlet
mod_osso s1 s2
OracleAS
Single
Sign-On Oracle
Internet
Directory
The following steps describe the responsibilities of Oracle components when an HTTP
client request is initiated in a J2EE environment with Oracle Single Sign-On enabled.
1. An HTTP client attempts to access a Web application, WebApp A1, hosted by
OC4J (the Web container for executing servlets). Oracle HTTP Server (using an
Apache listener) handles the request.
2. Oracle HTTP Server/mod_osso receives the request and:
■ Determines that WebApp A1 application requires Web-based Oracle Single
Sign-On for authenticating HTTP clients.
■ Redirects the HTTP client request to the Web-based Oracle Single Sign-On
(because it has not yet been authenticated).
3. The HTTP client is authenticated by OracleAS Single Sign-On through a user name
and password or through a user certificate. OracleAS Single Sign-On then:
See Also:
■ Oracle Application Server Single Sign-On Administrator’s Guide for
details on Oracle Single Sign-On
Important:
■ When you associate an OC4J instance with an Oracle Internet
Directory instance, the <jazn> element configuration in the
jazn.xml file of the OC4J home instance is rewritten and any
previous settings are lost.
■ Associating an Oracle Internet Directory instance with an OC4J
instance results in provider settings at the instance level—such as
the provider and location attribute settings in the <jazn>
element of the jazn.xml file. If you deploy an application to the
OC4J instance, and the application configures a different provider,
the result would be a mixed usage where the provider configured
in orion-application.xml would be the identity store used
for authentication, while the provider specified in jazn.xml
would be the policy store used for authorization. This is not
recommended.
5. In the Configure Identity Management: Application Server Control page, you can
optionally specify Oracle Identity Management as the security provider for
Application Server Control. (If you do this, only users and roles defined in the
Oracle Internet Directory instance will be able to access Application Server
Control.)
When you are done, go to the next page.
6. In the Configure Identity Management: Deployed Applications page, you can
optionally specify Oracle Internet Directory (actually, Oracle Identity
Management), with or without SSO, as the security provider for each deployed
application in the OC4J instance.
When you are done, choose Configure. This completes the OC4J-OID association
process and takes you back to the Identity Management page.
Notes:
■ Using SSL requires appropriate SSL configuration for OC4J and
Oracle Internet Directory, as discussed in Chapter 15, "SSL
Communication with OC4J", and the Oracle Internet Directory
Administrator’s Guide, respectively.
■ Because Oracle Internet Directory is associated at OC4J instance
level, OracleAS JAAS Provider picks up the Oracle Internet
Directory host, port, password, and SSL settings only from the
jazn.xml file of a given OC4J instance, not from any
application-level configuration.
■ Each user in a directory must have a unique distinguished name.
subsequent associations of the same or any other OC4J instance with the same Oracle
Internet Directory instance, these accounts are not changed. In fact, if any of these
accounts are found to already exist in Oracle Internet Directory at the time of the
OC4J-OID association process, the account creation step is skipped.
■ oc4jadmin user
■ oc4j-administrators role, with member oc4jadmin
■ oc4j-app-administrators role
■ ascontrol_admin (administrative role for all SOA controls, including
Application Server Control), with member oc4jadmin
■ ascontrol_appadmin (Application Server Control required role)
■ ascontrol_monitor (Application Server Control required role)
Notes:
■ In addition, the JAZNAdminGroup role with its OracleAS JAAS
Provider administrator member are shipped with Oracle Internet
Directory for internal use.
■ The file oidConfigForOc4j.sbs in directory
ORACLE_HOME/j2ee/home/jazn/install contains the OC4J
accounts and permissions for default users and roles that are
created in Oracle Internet Directory the first time an OC4J instance
is associated with that Oracle Internet Directory instance. Do not
modify or delete this file, as these accounts are required for
normal OC4J operations. Also, do not modify or delete any of
these default accounts or their permissions once they are created.
See Also:
■ "Predefined Accounts" on page 4-11 for additional information
about the OC4J accounts
■ "Activation of the oc4jadmin Account (Standalone OC4J)" on
page 4-12
The default realm "us" corresponds to the default identity management realm in
Oracle Internet Directory. Supported ldap.protocol settings are "ssl" or "no-ssl",
according to whether you use SSL connections. The default is to use SSL, so if you
specify SSL when you use Application Server Control, this does not actually result in
any ldap.protocol setting.
See Also:
■ "Configuring LDAP User and SSL Properties" on page 8-20
See Also:
■ "OC4J Configuration for Oracle Single Sign-On Authentication" on
page 8-14
See Also:
■ Oracle Application Server Single Sign-On Administrator’s Guide for
additional information about the ssoreg utility, including
options not mentioned here
Notes:
■ Procedures discussed throughout this section assume you are
logged in to Application Server Control as a user with required
administrative permissions (as oc4jadmin, for example).
■ To enable application access to EJBs over RMI, you must grant
RMI permission "login" to your user or role. When using the
Oracle Identity Management security provider, you can
accomplish this through the OracleAS JAAS Provider Admintool.
For example:
% java -jar jazn.jar -grantperm myrealm -role myrole \
com.evermind.server.rmi.RMIPermission login
Notes:
■ Specifying Oracle Identity Management as the security provider
for your application results in the setting provider="LDAP" in
the <jazn> element in orion-application.xml.
■ During deployment, there is no need to specify the Oracle Internet
Directory location, since this was already specified when you
associated OC4J with Oracle Internet Directory (and is reflected in
the <jazn> element in jazn.xml).
■ The default realm is the default Oracle Identity Management
realm. This is determined when Oracle Internet Directory is
installed.
3. In the Change Security Provider page, select Oracle Identity Management Security
Provider from the Security Provider Type dropdown.
4. Under "Security Provider Attributes: Oracle Identity Management Security
Provider" (which appears after you select Oracle Identify Management in the
dropdown):
■ Confirm the Oracle Internet Directory host and port are correct, as established
earlier when you associated the Oracle Internet Directory instance with your
OC4J instance.
■ Optionally enable Oracle Single Sign-On authentication. This results in the
configuration auth-method="SSO" for your application, as discussed in
"OC4J Configuration for Oracle Single Sign-On Authentication" on page 8-14.
Important: Do not confuse this with enabling Java SSO, which is a separate
feature (documented in Chapter 14, "OC4J Java Single Sign-On") that has its
own Application Server Control configuration page. You can use one SSO
product or the other, but not both.
5. Choose OK to finish the change.
This takes you back to the Security Provider page, where you are prompted to restart
the application for the change to take effect.
Notes:
■ You do not need an <auth-method> setting in the web.xml
file. Any setting in web.xml would be overridden by the "SSO"
setting in orion-application.xml.
■ The auth-method="SSO" setting is automatically written to
the orion-application.xml file when you specify Oracle
Identity Management with single sign-on when deploying an
application through Application Server Control.
■ The <jazn-web-app> element is also supported in the
orion-web.xml file. In the event of conflict, orion-web.xml
takes precedence over orion-application.xml for the
particular Web application in question.
See Also:
■ "Overview of Oracle Identity Management and Oracle Internet
Directory Tools" on page 4-4
■ "Configuring LDAP User and SSL Properties" on page 8-20
Note that the OracleAS JAAS Provider has its own Groups and Users containers. The
Groups container contains the role JAZNAdminGroup. The Users container contains
the OracleAS JAAS Provider administrative user that populates this role. Both the role
and its member user are for internal use only, and note that the administrative user
JAZNAdminUser is deprecated. An administrative user is created for each Oracle
Application Server middle tier associated with the Oracle Internet Directory. A typical
DN for the administrative user is something like the following:
orclapplicationcommonname=jaznadmin1,cn=jazncontext,cn=products,cn=oraclecontext
Using the identity management realm DN, the OracleAS JAAS Provider locates the
realm-specific Oracle context and creates a corresponding cn=JAZNContext subtree.
In Figure 8–3, cn=oracle is an identity management realm. The OracleAS JAAS
Provider stores the cn=usermgr entry, cn=rolemgr entry, and policy-related entries
under the JAZNContext entry corresponding to the identity management realm.
Figure 8–4 Simplified Directory Information Tree for the Identity Management Realm
com OracleContext
abc JAZNContext
us Realms
Users Roles us
Important:
■ Multiple Oracle Internet Directory realms are supported by
OracleAS JAAS Provider only in conjunction with the use of
Oracle Single Sign-On.
■ Do not use the OracleAS JAAS Provider Admintool to create
realms for Oracle Internet Directory. Realms created with this tool
are suitable for the file-based provider only, and would not
include sufficient information for use with Oracle Internet
Directory.
■ When you add a realm, you may need to make existing
applications aware of it. The procedure for doing this is specific to
each application; refer to the application documentation.
Additional steps are required for using Oracle Single Sign-On in a multi-realm
environment, to make the Oracle Single Sign-On server aware of the realms. In all,
using multiple realms with Oracle Single Sign-On consists of the following steps,
documented elsewhere (as referenced):
1. Create the realms, as summarized immediately above.
2. Configure the single sign-on server for multiple realms. This consists of the
following steps, covered in detail in the Oracle Application Server Single Sign-On
Administrator’s Guide.
a. Enable hosting on the single sign-on server. This is accomplished through a
script called enblhstg.csh.
b. Create an entry for each realm in the Oracle Single Sign-On database. This is
accomplished through a script called addsub.csh.
c. Update the sample login page to create a version of the page for multiple
realms.
d. Stop and restart the Oracle Single Sign-On middle tier.
3. Grant administrative privileges for multiple realms. This is also discussed in the
Oracle Application Server Single Sign-On Administrator’s Guide.
4. Configure Oracle Single Sign-On as described in "Configure SSO (Optional)" on
page 8-9.
5. Configure the SSO authentication method setting in OC4J, as described in "OC4J
Configuration for Oracle Single Sign-On Authentication" on page 8-14.
The authentication sequence for single sign-on to multiple realms is much the same as
it is for single sign-on in a single, default realm. The only difference from the user's
perspective is that, when a user affiliated with the first type of realm is presented with
the login screen, the user must enter not only a user name and password but also a
new credential, the realm nickname.
Once a user has entered his credentials, both his realm nickname and user name are
mapped to entries in Oracle Internet Directory. More specifically, the single sign-on
server uses directory metadata to find the realm entry in the directory. Once it finds
this entry, the single sign-on server uses realm metadata to locate the user. Once the
user's entry is found, his password, an attribute of his entry, is validated. And once his
password is validated, he is authenticated.
See Also:
■ Oracle Identity Management Guide to Delegated Administration for
information about creating users and roles, through the Oracle
Delegated Administration Services (DAS), when using Oracle
Identity Management
</jazn>
Oracle Internet Directory supports null authentication for SSL communication. Data
are encrypted with the Anonymous Diffie-Hellman cipher suite, but no certificates are
used for authentication.
See Also:
■ "SSL Authentication" on page 1-4
Table 8–5 describes LDAP caching properties and their default values. You can set
these properties in <property> subelements under the <jazn> element in the
instance-level jazn.xml file, as follows:
<jazn ... >
...
<property name="propname" value="propvalue" />
...
</jazn>
Caching is enabled by default. You should disable the caches when performing certain
management and administrative tasks. In particular:
■ Disable the realm cache when managing realms. This includes adding realms,
dropping realms, granting roles, and revoking roles.
■ Disable the session cache when you disable HTTP session cookies.
The following example disables all three caches:
<jazn provider="LDAP" location="ldap://myhost.example.com:636" >
...
<property name="ldap.cache.session.enable" value="false" />
<property name="ldap.cache.realm.enable" value="false" />
<property name="ldap.cache.policy.enable" value="false" />
...
</jazn>
-Dldap.cache.session.enable=false
-Dldap.cache.realm.enable=false
-Dldap.cache.policy.enable=false
The following example leaves all caches enabled, and sets a cache size of 100 and a
10,000-millisecond timeout:
<jazn provider="LDAP" location="ldap://myhost.example.com:636" >
<property name="ldap.cache.initial capacity" value="100" />
<property name="ldap.cache.purget.timeout" value="10000" />
</jazn>
Notes:
■ The OracleAS JAAS Provider Admintool automatically disables
caching while it is in operation, then reenables caching when it
finishes.
■ The configurations discussed here must be performed manually;
there is currently no support for these in Application Server
Control.
Note: In the jazn.xml file of the OC4J home instance, the <jazn>
element has the setting provider="LDAP" to use the LDAP-based
provider. This element also reflects the Oracle Internet Directory
location and port.
This will return the Oracle Internet Directory realm, which is useful if you use multiple
identity management realms in Oracle Internet Directory and would like to configure
a specific nondefault realm for J2EE applications.
See Also:
■ Oracle Internet Directory Administrator’s Guide for information
about the ldapsearch command
Avoiding OC4J Restart for Oracle Internet Directory Changes to Take Effect
When doing administration to Oracle Internet Directory, such as adding grantees,
permissions, or groups, you should disable LDAP caching. If caching is left enabled,
your changes will not take effect until you stop and restart OC4J. See "Configuring
LDAP Caching Properties" on page 8-22 for how to disable caching.
See Also:
■ Oracle Application Server Single Sign-On Administrator’s Guide for
additional information about the Oracle Single Sign-On
administration pages
This chapter discusses login modules supplied with OC4J, as well as how to
implement, install, and configure a custom login module. The following topics are
covered:
■ Initial Login Module Considerations
■ Login Modules Supplied with OC4J
■ Introducing Custom JAAS Login Modules
■ Summary of Choices for Packaging Login Modules
■ Configuring the Custom Security Provider in Application Server Control
■ Using Admintool to Configure Login Modules and Grant RMI Permission
■ Summary of Login Module Configuration in OC4J Configuration Files
■ Step by Step: Integrating a Custom Login Module with OC4J
■ Custom Login Module Example
See Also:
■ "JAAS Authentication: Login Modules" on page 2-13
The Oracle login configuration provider uses the system-jazn-data.xml file for
login module configuration.
Troubleshooting Tips:
■ If an application is configured to use a custom login module but
the login module is not found in the classpath, a "class not found"
exception is thrown with a message such as the following:
"WARNING unable to find LoginModule class: Missing class:
Xxxxxx..." See "Summary of Choices for Packaging Login
Modules" on page 9-13 for related information.
■ Be aware that when you use a custom login module, role
comparisons for authorization are not case-sensitive unless you
add the following property setting to the <jazn> element in
orion-application.xml:
<property name="role.compare.ignorecase" value="false" />
Notes:
■ This table does not show additional login modules internal to
OC4J.
■ Oracle does not currently validate Sun login modules for use with
OC4J. (These login modules, in package
com.sun.security.auth.module, are not currently part of
the JDK.)
This rest of this section offers additional information about the following login
modules:
■ RealmLoginModule
■ DBTableOraDataSourceLoginModule
RealmLoginModule
The RealmLoginModule class is the default login module, for use with the file-based
provider or Oracle Identity Management, and is configured when you configure these
security providers through Application Server Control. This configuration is reflected
in a <login-module> element under <jazn-loginconfig> in the
system-jazn-data.xml file.
The RealmLoginModule class authenticates user login credentials before the user can
access J2EE applications. Authentication is performed using OC4J container-based
authentication (HTTP basic, form-based, and so on).
RealmLoginModule supports the options shown in Table 9–2 (reflected in <name>
and <value> subelements of an <option> element under <login-module>).
Notes:
■ RealmLoginModule does not have to be enabled if your
application uses Oracle Single Sign-On authentication.
■ RealmLoginModule is used only with declarative security, not
programmatic security.
■ The use of RealmLoginModule as a custom login module—in
other words, as a custom security provider—is not supported.
See Also:
■ "Login Module Settings in system-jazn-data.xml" on page 9-21
■ "Using Admintool to Configure Login Modules and Grant RMI
Permission" on page 9-19 for information on using the
Admintool
<application>
<name>oracle.security.jazn.tools.Admintool</name>
<login-modules>
<login-module>
<class>oracle.security.jazn.realm.RealmLoginModule</class>
<control-flag>required</control-flag>
<options>
<option>
<name>debug</name>
<value>false</value>
</option>
<option>
<name>addAllRoles</name>
<value>true</value>
</option>
</options>
</login-module>
</login-modules>
</application>
<application>
<name>oracle.security.jazn.oc4j.JAZNUserManager</name>
<login-modules>
<login-module>
<class>oracle.security.jazn.realm.RealmLoginModule</class>
<control-flag>required</control-flag>
<options>
<option>
<name>addAllRoles</name>
<value>true</value>
</option>
</options>
</login-module>
</login-modules>
</application>
</jazn-loginconfig>
DBTableOraDataSourceLoginModule
The OC4J 10.1.3.1 implementation supplies a login module you can use if you have a
user identity store in a database:
oracle.security.jazn.login.module.db.DBTableOraDataSourceLoginModule
■ DBTableOraDataSourceLoginModule Options
■ Configuring DBTableOraDataSourceLoginModule in Application Server Control
■ Configuring DBTableOraDataSourceLoginModule in the Admintool
■ Sample DBTableOraDataSourceLoginModule Settings in system-jazn-data.xml
■ Principals for DBTableOraDataSourceLoginModule
■ Implementing DBLoginModuleEncodingInterface for Password Encryption
■ Previous Functionality: DataSourceUserManager (Deprecated)
DBTableOraDataSourceLoginModule Options
Table 9–3 summarizes the options supported by
DBTableOraDataSourceLoginModule, noting which options are required, and
including default values as applicable and examples as appropriate. There is no
configuration of this login module in OC4J as shipped; refer to the sections that follow,
"Configuring DBTableOraDataSourceLoginModule in Application Server Control" and
"Configuring DBTableOraDataSourceLoginModule in the Admintool", for information
about tools you can use in configuring the login module.
Note that DBTableOraDataSourceLoginModule supports encrypted passwords in
the database table, and you can use custom password encryption algorithms. To use
this feature, you must use an implementation of the following interface, discussed in
"Implementing DBLoginModuleEncodingInterface for Password Encryption" on
page 9-10:
oracle.security.jazn.login.module.db.DBLoginModuleEncodingInterface
Notes:
■ It is permissible to use the same table for user information and
role information; in other words, to specify the same table for the
table and groupMembershipTableName options. Notice that
in this scenario, however, each user can have only one role. It is
typical, and advisable, to use separate tables.
■ DBTableOraDataSourceLoginModule does not support null
or empty passwords.
■ If you use password encryption, passwords are compared
according to their encrypted values, not the unencrypted strings.
When a user logging in types the password, it is encrypted
according to the encrypting method of the class you specify in the
pw_encoding_class option, and compared to the encrypted
password stored in the database. No attempt is made to decrypt
the password stored in the database.
</class>
<control-flag>required</control-flag>
<options>
<option>
<name>data_source_name</name>
<value>jdbc/OracleDS</value>
</option>
<option>
<name>table</name>
<value>userinfo</value>
</option>
<option>
<name>roles_fk_column</name>
<value>userName</value>
</option>
<option>
<name>groupMembershipGroupFieldName</name>
<value>role</value>
</option>
<option>
<name>user_pk_column</name>
<value>userName</value>
</option>
<option>
<name>passwordField</name>
<value>passWord</value>
</option>
<option>
<name>groupMembershipTableName</name>
<value>groupinfo</value>
</option>
<option>
<name>usernameField</name>
<value>userName</value>
</option>
<option>
<name>casing</name>
<value>sensitive</value>
</option>
</options>
</login-module>
</login-modules>
</application>
...
</jazn-loginconfig>
See Also:
■ "Summary of Login Module Configuration in OC4J Configuration
Files" on page 9-21
The implementing class must implement the following method, which is called by the
login module:
■ String getKeyDigestString(String text, String key)
This method takes a text string to encrypt (such as a password) and a string that
specifies a key, as set in the pw_key option for the login module (if applicable). The
method would then encrypt the text string with any desired algorithm (with the key if
specified), and preferably also formats the post-encryption binary data using any
desired encoding standard (Base64Encoding, for example). It outputs the encrypted
digest string.
For algorithms that do not use a key, such as MD5 or SHA1, any key passed could be
ignored. If the pw_key option is not set, then its value is null and null is passed.
Oracle provides the following implementations in the
oracle.security.jazn.login.module.db.util package:
■ DBLoginModuleSHA1Encoder
This class generates a hash value for the given password string using the SHA1
algorithm, and encodes the binary hash using Base64Encoding. The binary hash
of the password must be stored in the database using Base64Encoding.
■ DBLoginModuleMD5Encoder
This class generates a hash value for the given password string using the MD5
algorithm, and encodes the binary hash using Base64Encoding. The binary hash
of the password must be stored in the database using Base64Encoding.
■ DBLoginModuleClearTextEncoder
If you do not specify an encryption class, DBLoginModuleClearTextEncoder
is used, resulting in no encryption. This class simply passes the password string as
it is given.
Notes:
■ The database you use must be specified as a data source, for
which you provide a JNDI location in your configuration. The
configuration also specifies the relevant database tables and
fields.
■ In OC4J 10.1.3.x implementations, DataSourceUserManager
obtains group information only from the database, which
differs from the behavior in previous implementations.
Therefore, you must map groups to users in the database, as
applicable.
A custom login module may be desirable, for example, when users and roles are
defined in an external repository. When you create a custom login module, consider
the following preliminary questions:
■ Development: Do you want to take advantage of J2EE security constraints?
■ Debugging: Do you want the login module to support a debugging option for use
during development? (As noted previously, RealmLoginModule, for example,
supports a debug option that provides diagnostic output. Also, "Custom Login
Module Example" on page 9-28 includes debugging functionality.)
■ Packaging and deployment: Are you using login modules that come with OC4J or
J2SE 1.4? Or are you deploying custom or third-party login modules? And are you
packaging the login modules with your application, or making them available
separately as an optional package or library?
When you associate a custom login module with an application (through
configuration, as shown later), the subject and the principals it contains are used as the
sole basis for all authorization tasks, including evaluating J2EE security constraints. To
ensure that all relevant principals are considered during authorization, the login
module must add the relevant principals, including all roles that the authenticated
user participates in, to the subject during the commit phase of the authentication
process. (The role.mapping.dynamic property, discussed in "Settings in <jazn> for
Login Modules" on page 9-23, is related to subject-based authorization.)
The custom login module framework supports the J2EE declarative security model.
This means that subject-based authorization enforces the J2EE security constraints
declared in application deployment descriptors (web.xml and ejb-jar.xml, for
example).
Custom login modules are configured through the OC4J system-jazn-data.xml
file, which can be updated automatically through use of tools such as Application
Server Control Console and OracleAS JAAS Provider Admintool. You can also
configure login modules through orion-application.xml, in which case the
configuration is copied to system-jazn-data.xml.
See Also:
■ "JAAS Authentication: Login Modules" on page 2-13
■ Sun Microsystems JAAS documentation for general information
about developing custom login modules:
http://java.sun.com/j2se/1.4.2/docs/guide/security/jaa
s/JAASLMDevGuide.html
See Also:
■ "Configuring the Custom Security Provider in Application Server
Control" on page 9-15
■ "Using Admintool to Configure Login Modules and Grant RMI
Permission" on page 9-19
as desired. In this way, classes in the login module JAR file can be used by classes
in the other JAR files that reference it.
The login modules must also be configured in system-jazn-data.xml, as
discussed in "Login Module Settings in system-jazn-data.xml" on page 9-21.
See Also:
■ For general information about the standard "optional package"
mechanism:
http://java.sun.com/j2se/1.4.2/docs/guide/extensions
Notes:
■ Procedures discussed throughout this section assume you are
logged in to Application Server Control as a user with required
administrative permissions (as oc4jadmin, for example).
■ Any login module you specify must be in the classpath at
runtime. (One option is to load it as a shared library, as described
in "Tasks to Share a Library" on page 6-14.)
■ To add a new custom login module, choose Add Login Module. See "Adding
a Custom Login Module during Deployment" on page 9-17.
■ To edit an existing custom login module, choose the Edit task for the
appropriate module. See "Editing a Custom Login Module Configuration
during Deployment" on page 9-16.
■ To delete an existing custom login module, choose the Delete task for the
appropriate module.
4. Still in the Deployment Settings: Select Security Provider page, choose OK to
finish the security provider selection.
5. Back in the Deploy: Deployment Settings page, choose Deploy to complete the
deployment, or choose another task, as desired. The list of tasks is noted in
"Deploying an Application through Application Server Control" on page 6-8.
Deploying or configuring a custom login module through Application Server Control
results in the following required settings being inserted automatically in the
orion-application.xml file:
<jazn provider="XML">
<property name="role.mapping.dynamic" value="true" />
<property name="custom.loginmodule.provider" value="true" />
</jazn>
Notes:
■ Grants for custom login modules, which are stored in
system-jazn-data.xml, cannot be configured through
Application Server Control.
■ By convention, there is a <jazn> setting of provider="XML"
when you use custom login modules.
■ Custom login module configuration settings are reflected under
the <jazn-loginconfig> element in the
system-jazn-data.xml file, as shown in "Login Module
Settings in system-jazn-data.xml" on page 9-21.
See Also:
■ "Summary of Login Module Configuration in OC4J Configuration
Files" on page 9-21 and "Step by Step: Integrating a Custom Login
Module with OC4J" on page 9-24 for information and examples
regarding the resulting XML configuration for login modules
■ Specify a value for the login module control flag (from the dropdown list):
Required, Requisite, Optional, or Sufficient. Table 9–5 describes these settings.
■ As desired, choose Add Another Row to create properties.
■ As desired, edit the name or value of any property in the Properties list.
■ As desired, use the Delete task for a property to remove that property.
■ Choose Continue to go back to the Deployment Settings: Select Security
Provider page to continue the deployment steps in "Specifying and
Configuring a Custom Security Provider during Deployment" on page 9-15.
These control flag settings are used according to standard functionality of the
javax.security.auth.login.Configuration class. The overall authentication
succeeds only if all "required" and "requisite" login modules succeed, possibly unless a
"sufficient" login module is configured and succeeds—in that case, only the required
and requisite login modules prior to the sufficient login module in the login module
list must succeed.
This takes you back to the Security Provider page, where you can examine the settings.
See Also:
■ Appendix C, "OracleAS JAAS Provider Admintool Reference"
You can also execute these commands from the Admintool shell.
See Also:
■ "Adding and Removing Login Modules" on page C-10
■ "Listing Login Modules" on page C-15
(Always specify a realm when granting permissions to a user or role, but not when
granting permissions to a principal.)
If you are in an Oracle Application Server environment with multiple OC4J instances,
then you must specify the appropriate instance name (and hence the appropriate home
directory) for the applicable OC4J instance, so that the system-jazn-data.xml file
for the appropriate OC4J instance is updated. Set %oracleas.oc4j.instance%
appropriately for your environment.
% java -jar -Doracle.j2ee.home=%ORACLE_HOME%/j2ee/%oracleas.oc4j.instance% \
jazn.jar -grantperm myrealm -role managers \
com.evermind.server.rmi.RMIPermission login
See Also:
■ "Granting and Revoking Permissions" on page C-14
<login-modules>
<login-module>
<class>mypath.MyLoginModule</class>
<control-flag>required</control-flag>
<options>
<option>
<name>myoptionname</name>
<value>myoptionvalue</value>
</option>
</options>
</login-module>
</login-modules>
</application>
</jazn-loginconfig>
..
</jazn-data>
This fragment associates the login module MyLoginModule with the application
myapp.
See Also:
■ "The system-jazn-data.xml File" on page 4-7
■ Table 9–5, " Login Module Control Flags" on page 9-17 for
information about control flag settings
■ "Configuring the Custom Security Provider in Application Server
Control" on page 9-15
■ "Using Admintool to Configure Login Modules and Grant RMI
Permission" on page 9-19
See Also:
■ Oracle Containers for J2EE Developer’s Guide for general reference
information about orion-application.xml
</namespace-access>
...
</orion-application>
This assumes the indicated role mappings had already been set up elsewhere in
orion-application.xml.
See Also:
■ "Configuring Namespace Access" on page 18-8
See Also:
■ Oracle Containers for J2EE Resource Adapter Administrator’s Guide for
additional information about configuring resource adapters
See Also:
■ javax.security.auth.spi.LoginModule Javadoc:
http://java.sun.com/j2se/1.4.2/docs/api/
You could manually put this configuration into the orion-application.xml file
before deployment, or set the parameters (class name, control flag, and option names
and values) as prompted during deployment when you deploy your application
through Application Server Control. In either case, the configuration will
automatically be written to system-jazn-data.xml.
<security-role-mapping name="sr_manager">
<group name="managers"/>
</security-role-mapping>
</namespace-resource>
</read-access>
</namespace-access>
...
</orion-application>
This assumes the role mappings—mapping logical roles defined in the application to
roles supported by the custom login module—have been properly defined, as in the
following example from orion-application.xml:
<orion-application ... >
...
<!-- Mapping the logical roles to the container roles -->
<security-role-mapping name="sr_manager">
<group name="managers" />
</security-role-mapping>
<security-role-mapping name="sr_developer">
<group name="developers" />
</security-role-mapping>
...
</orion-application>
You can specify role mappings through Application Server Control, as discussed in
"Mapping Security Roles" on page 6-10. This results in the orion-application.xml
entries being added automatically.
(The ormi protocol is for standalone OC4J, while the opmn:ormi protocol is for an
Oracle Application Server environment. Uncomment the appropriate one.)
Look for the login module how-to under "J2EE Security / JAAS".
SampleLoginModule Code
This section contains the code for the sample login module.
package oracle.security.jazn.samples;
import java.util.Set;
import java.util.Iterator;
import java.util.Map;
import java.security.Principal;
import javax.security.auth.Subject;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.PasswordCallback;
import javax.security.auth.login.LoginException;
import javax.security.auth.spi.LoginModule;
// initial state
protected Subject _subject;
protected CallbackHandler _callbackHandler;
protected Map _sharedState;
protected Map _options;
// configuration options
protected boolean _debug;
/*
* Initialize this LoginModule.
*
* subject the Subject to be authenticated.
* callbackHandler a CallbackHandler for communicating
* with the end user (prompting for usernames and
* passwords, for example).
* sharedState shared LoginModule state.
* options options specified in the login
if (debug()) {
printConfiguration(this);
}
}
/*
* Authenticate the user by prompting for a username and password.
*
* return true if the authentication succeeded, or false if this
* LoginModule should be ignored.
* throws FailedLoginException if the authentication fails.
* throws LoginException if this LoginModule
* is unable to perform the authentication.
*/
public boolean login() throws LoginException {
if (debug())
System.out.println("\t\t[SampleLoginModule] login");
if (_callbackHandler == null)
throw new LoginException("Error: no CallbackHandler available " +
"to garner authentication information from the user");
try {
_callbackHandler.handle(callbacks);
} catch (Exception e) {
_succeeded = false;
throw new LoginException(e.getMessage());
}
new String(((PasswordCallback)callbacks[1]).getPassword());
if (debug())
{
System.out.println("\t\t[SampleLoginModule] username : " + username);
}
((PasswordCallback)callbacks[1]).clearPassword();
callbacks[0] = null;
callbacks[1] = null;
if (debug())
{
System.out.println("\t\t[SampleLoginModule] success : " + _succeeded);
}
if (!_succeeded)
throw new LoginException
("Authentication failed: Password does not match");
return true;
}
/*
* This method is called if the LoginContext's
* overall authentication succeeded
* (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules
* succeeded).
*
* If this LoginModule's own authentication attempt
* succeeded (checked by retrieving the private state saved by the
* login method, then this method associates a
* Principal with the Subject located in the
* LoginModule. If this LoginModule's own
* authentication attempted failed, then this method removes
* any state that was originally saved.
*
* return true if this LoginModule's own login and commit
* attempts succeeded, or false otherwise.
* throws LoginException if the commit fails.
*/
public boolean commit()
throws LoginException {
try {
if (_succeeded == false) {
return false;
}
if (_subject.isReadOnly()) {
throw new LoginException("Subject is ReadOnly");
}
_commitSucceeded = true;
return true;
} catch (Throwable t) {
if (debug()) {
System.out.println(t.getMessage());
t.printStackTrace();
}
throw new LoginException(t.toString());
}
}
/*
* This method is called if the LoginContext's
if (_succeeded == false) {
cleanup();
return false;
} else if (_succeeded == true && _commitSucceeded == false) {
// login succeeded but overall authentication failed
_succeeded = false;
cleanup();
} else {
// overall authentication succeeded and commit succeeded,
// but someone else's commit failed
logout();
}
return true;
}
if (getAuthPrincipals() != null) {
for (int i = 0; i < getAuthPrincipals().length; i++) {
_subject.getPrincipals().remove(getAuthPrincipals()[i]);
}
}
}
/*
* Logout the user.
*
* This method removes the Principal
* that was added by the commit method.
*
// helper methods //
s = subject.getPublicCredentials();
if ((s != null) && (s.size() != 0)) {
System.out.println
("\t\t[SampleLoginModule] added the following Public Credentials:");
printSet(s);
}
} catch (Throwable t) {
}
}
}
SamplePrincipal Code
This section contains the code for the sample principal.
The login module sets the SamplePrincipal instance in the current Subject
instance. To create the SamplePrincipal instance, the login module directly invokes
the SamplePrincipal constructor, so the constructor is defined as public.
package oracle.security.jazn.samples;
import java.security.Principal;
/*
* This class implements the Principal interface
* and represents a Sample user.
*
* Principals such as this SamplePrincipal
* may be associated with a particular Subject
* to augment that Subject with an additional
* identity. Authorization decisions can then be based upon
* the Principals associated with a Subject.
*
*/
public class SamplePrincipal implements Principal {
/*
* Create a SamplePrincipal with a Sample username.
*
*/
public SamplePrincipal(String name) {
if (name == null)
throw new NullPointerException("name cannot be null");
_name = name;
}
/*
* Return a string representation of this SamplePrincipal.
*
*/
public String getName() {
return _name;
}
/*
* Return a hash code for this SamplePrincipal.
*
*/
public int hashCode() {
return _name.hashCode();
}
/*
* Return a string representation of this SamplePrincipal.
*
*/
public String toString() {
return "[SamplePrincipal] : " + _name;
}
/*
* Compares the specified Object with this SamplePrincipal
if (this == o)
return true;
if (this.getName().equals(that.getName()))
return true;
return false;
}
}
Notes:
■ Support for external LDAP providers requires JDK 1.4 or later.
■ Beginning with OC4J 10.1.3.x implementations, external LDAP
providers are supported in standalone OC4J as well as in an
Oracle Application Server environment.
■ The concept of security realms is not supported when using
external LDAP providers.
■ See "OracleAS JAAS Provider Policy Management" on page 5-12
regarding subject-based policy management when using an
external LDAP provider. The policy configuration must be in
system-jazn-data.xml.
See Also:
■ For information about user and role APIs that you can use with
external LDAP providers, Chapter 12, "User and Role API
Framework"
Notes:
■ Note that by convention, the <jazn> setting provider="XML" is
used for external LDAP providers.
■ Be aware that when you use an external LDAP provider, role
comparisons for authorization are not case-sensitive unless you
add the following property setting to the <jazn> element in
orion-application.xml:
<property name="role.compare.ignorecase" value="false" />
Note: Sample login module entries for Sun Java System Directory
Server and Microsoft Active Directory are provided in the directory
ORACLE_HOME/j2ee/home/jazn/config. A non-provider-specific
login module entry is provided in the file
ldap_login_module.template in the
ORACLE_HOME/j2ee/home/jazn/config directory.
Or, alternatively, choose Set Values to Vendor Defaults for the vendor specified
through the LDAP Directory Vendor setting. Apart from this, you must still
specify LDAP Location, User DN, User Search Base, and Group Search Base.
4. You can optionally choose Test LDAP Authorization prior to deployment. This
tests whether the LDAP session can successfully be created, thereby confirming
key settings such as the LDAP host, port, administrative user, and password.
5. Choose OK to finish the security provider selection.
6. Back in the Deploy: Deployment Settings page, choose Deploy to complete the
deployment, or choose another task, as desired. The list of tasks is noted in
"Deploying an Application through Application Server Control" on page 6-8.
Table 10–2 Application Server Control External LDAP Connection Pool Options
Option Default Description
Initial Size of Connection Pool 2 Number of connections initially created in the pool
for each connection identity.
Maximum Size of Connection Pool 25 Maximum number of connections that can be
concurrently maintained in the pool for each
connection identity.
Preferred Size of Connection Pool 10 Preferred number of connections in the pool for
each connection identity.
Idle Connection Timeout (milliseconds) 300000 (5 minutes) The amount of time that an idle connection can
remain in the pool before being removed.
Table 10–4 Application Server Control External LDAP Role and Member Options
Required? Equivalent Option in Table 10–7 (see for
Option Or Settings / Default description)
Group Search Base Required oracle.security.jaas.ldap.role.searchbase
Group Search Scope Subtree (default) or One Level oracle.security.jaas.ldap.role.searchscope
(from dropdown menu)
Note: Although the default in
the dropdown menu is Subtree,
the vendor default is One
Level.
LDAP Group Name Attribute Required oracle.security.jaas.ldap.role.name.attribute
LDAP Group Object Class Required oracle.security.jaas.ldap.role.object.class
LDAP Group Member Attribute Required oracle.security.jaas.ldap.member.attribute
Group Membership Scope Direct (default) or Nested (from oracle.security.jaas.ldap.membership.searchscope
Search dropdown menu)
■ Table 10–4, " Application Server Control External LDAP Role and Member
Options"
Or, alternatively, choose Set Values to Vendor Defaults for the vendor specified
through the LDAP Directory Vendor setting. Apart from this, you must still
specify LDAP Location, User DN, User Search Base, and Group Search Base.
5. You can optionally choose Test LDAP Authorization prior to deployment. This
tests whether the LDAP session can successfully be created, thereby confirming
key settings such as the LDAP host, port, administrative user, and password.
6. Choose OK to finish the change.
This takes you back to the Security Provider page, where you are prompted to restart
your application for the changes to take effect.
See Also:
■ "Settings in system-jazn-data.xml for Sun Java System Directory
Server" on page 10-11 for examples of some option settings
Here is an example:
<option>
<name>oracle.security.jaas.ldap.provider.url</name>
<value>ldap://myhost.example.com:389</value>
</option>
...more options...
</options>
</login-module>
...
</login-modules>
</application>
...
</jazn-loginconfig>
...
</jazn-data>
Creating the Administrative User and Roles and Granting RMI Permission
When you use an external LDAP provider, you must define an administrative user
account and administrator roles, grant the roles to the user, and grant necessary
permissions to the roles. (These steps are handled automatically in the file-based
security provider and Oracle Internet Directory.)
1. Create an administrative user account in the external LDAP directory, using the
appropriate tool for the security provider. (The name oc4jadmin is used for the
administrator account by convention, but you can use any name.)
2. Create the administrator roles oc4j-administrators and ascontrol_admin
in the external LDAP directory, using the appropriate tool. These roles must be
under the group search base configured for the LDAP provider. (See Table 10–4 on
page 10-5 and Table 10–7 on page 10-7 for information about the group search
base.)
3. Grant these roles to the administrative user, using the appropriate tool.
4. Create the additional administrator roles oc4j-app-administrators,
ascontrol_appadmin, and ascontrol_monitor. (These do not have to be
granted to the administrative user.)
5. If the administrator must access EJBs, grant these roles RMI permission "login".
You can use the OracleAS JAAS Provider Admintool for this, as in the following
example:
% java -jar jazn.jar -grantperm myrealm -role oc4j-administrators \
com.evermind.server.rmi.RMIPermission login
Be aware that although the roles are defined in the external LDAP provider, these
permission grants are stored in the system-jazn-data.xml file.
See Also:
■ "Predefined Accounts" on page 4-11
</grantee>
...
<permissions>
<permission>
<class>com.evermind.server.rmi.RMIPermission</class>
<name>login</name>
</permission>
...
</permissions>
...
</grant>
...
</jazn-policy>
Refer to "Introduction to JAAS Mode" on page 5-5 and "Configuring and Using JAAS
Mode" on page 5-18 to gain an understanding of when and how to use this mode.
</option>
<option>
<name>oracle.security.jaas.ldap.user.name.attribute</name>
<value>uid</value>
</option>
<option>
<name>oracle.security.jaas.ldap.user.object.class</name>
<value>inetOrgPerson</value>
</option>
<option>
<name>oracle.security.jaas.ldap.user.searchbase</name>
<value>dc=us,dc=example,dc=com</value>
</option>
<option>
<name>oracle.security.jaas.ldap.role.name.attribute</name>
<value>cn</value>
</option>
<option>
<name>oracle.security.jaas.ldap.role.object.class</name>
<value>groupOfUniqueNames</value>
</option>
<option>
<name>oracle.security.jaas.ldap.role.searchbase</name>
<value>ou=groups,dc=us,dc=example,dc=com</value>
</option>
<option>
<name>oracle.security.jaas.ldap.member.attribute</name>
<value>uniqueMember</value>
</option>
</options>
</login-module>
</login-modules>
</application>
</jazn-loginconfig>
...
</jazn-data>
You must restart OC4J to synchronize the login module information from
system-jazn.data.xml.
identifies the container, as well as the certificate of the CA that issued its certificate
(issued the OC4J certificate).
■ All trustpoints (CAs) used in the process must be imported into the wallets or
keystores used by the external LDAP provider and by OC4J. If different CAs are
used to sign the OC4J and external LDAP provider certificates, then the OC4J and
external LDAP provider wallet or keystore each must contain a copy of the
certificate of each of these CAs.
You can use the following general steps to configure an external LDAP provider, such
as Active Directory or Sun Java System Directory Server, for SSL using standard JSSE
functionality and one-way authentication (two-way authentication is not supported
for use with external LDAP providers in the current release):
1. Import the root CA certificate from the directory server to your local machine. For
example, create your own keystore and then import the root CA certificate to this
keystore. You can accomplish this using the JSSE keytool.
2. Set Java system properties as necessary for your truststore:
■ Set the -Djavax.net.ssl.trustStore property to indicate the path to
your wallet or keystore that serves as truststore.
■ If you need to secure the truststore, also set the
-Djavax.net.ssl.trustStorePassword property. (This may not
necessary for one-way authentication, as the truststore would typically contain
only public keys.)
For standalone OC4J, accomplish this on the JVM command line. In an Oracle
Application Server environment, accomplish this through Java property settings
for the OC4J instance in the opmn.xml file.
Here is a sample opmn.xml entry for the OC4J home instance:
<ias-component id="OC4J">
<process-type id="home" module-id="OC4J" status="enabled">
<module-data>
<category id="start-parameters">
<data id="java-options" value="-Xrs -server
-Djava.security.policy=
$ORACLE_HOME/j2ee/home/config/java2.policy
-Djava.awt.headless=true
-Dhttp.webdir.enable=false"
-Djavax.net.ssl.trustStore=pathtotruststore/>
</category>
...
</module-data>
...
</process-type>
</ias-component>
See Also:
■ "Using Keys and Certificates with OC4J and Oracle HTTP Server"
on page 15-2 and "Using SSL with Standalone OC4J" on page 15-5
for introductory information about keytool
■ For detailed information about the keytool utility:
http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/k
eytool.html
This chapter discusses how to use the Oracle Access Manager security provider,
formerly known as Oracle COREid Access and Identity, for authentication,
authorization, and single sign-on. The chapter is useful for those who have already
deployed, or plan to deploy, the Oracle Access Manager system. It describes
integration between the Oracle Access Manager 10.1.4 implementation and the OC4J
10.1.3.1 implementation, and how to secure applications deployed on OC4J through
features of Oracle Access Manager. This includes detailed configuration steps for Web
applications, and examples for Web applications, EJBs, and Web Service authentication
schemes (including username token, X.509 token, and SAML token).
This chapter covers the following topics:
■ Getting Started with Oracle Access Manager
■ Oracle Access Manager Concepts
■ Configuring Oracle Access Manager
■ Configuring OC4J with the Access Manager SDK
■ Configuring opmn.xml for Oracle Access Manager
■ Creating Required Accounts in the LDAP Server
■ Configuring the Application
■ Granting Permissions to Oracle Access Manager Principals
■ Considerations for Oracle Application Server SOA Applications
■ Oracle Access Manager Examples for J2EE Applications
■ Oracle Access Manager Support and Examples for Web Services
■ Troubleshooting the Oracle Access Manager Setup
Notes:
■ The emphasis in this chapter is on what you must do from an
OC4J and OracleAS JAAS Provider perspective to enable the use
of Oracle Access Manager with Oracle Application Server. Some
prior familiarity with Oracle Access Manager is assumed, and
there is no attempt to thoroughly document the use of its features
or tools. In terms of what to do for necessary Oracle Access
Manager setup, the emphasis is on required settings, and how
they map to OracleAS JAAS Provider configuration, rather than
on how to accomplish the settings. Please consult Oracle Access
Manager documentation for details on its features and
administration.
■ Only the 10.1.4 implementation of Oracle Access Manager is
supported with the 10.1.3.1 implementation of OC4J.
See Also:
■ Oracle Access Manager Installation Guide
■ Oracle Access Manager System Administration Guide for information
related to settings of the Access Server (described later in this
chapter) and definition of access controls and user access to
applications and data
■ Oracle Access Manager Identity and Common Administration Guide
for information related to Identity Server settings and functions
common to both the Access Server and Identity Server (both
described later in this chapter)
■ Oracle Access Manager Developer Guide
These and other Oracle Access Manager documents are available
through:
http://www.oracle.com/technology/documentation/index.html
They are available with the Oracle Identity Management 10.1.4
documentation release, listed under "Application Servers".
See Also:
■ Oracle Access Manager Installation Guide for installation instructions
At a high level, prerequisites include installing Oracle Access Manager and Oracle
Application Server, and configuring the Access Manager SDK and your applications
on OC4J.
Detailed requirements on the Oracle Access Manager side:
1. A suitable LDAP repository, such as Oracle Internet Directory (included in the
Oracle Application Server 10.1.4 or 10.1.2 infrastructure).
2. A Web server, such as Oracle HTTP Server (included in the Oracle Application
Server 10.1.3.x middle-tier infrastructure).
3. The Oracle Access Manager Identity Server and Access Server. When you install
Oracle Access Manager, you will be asked to specify the LDAP repository you are
using, which must be accessible for communication with Oracle Access Manager
Identity Server and Access Server during runtime.
4. Oracle Access Manager WebGate, WebPass, and Policy Manager installed on the
Web server. WebGate is the SSO interceptor and communicates with Access Server
during runtime. WebPass communicates with Oracle Access Manager Identity
Server. Policy Manager communicates with the LDAP repository. When you install
WebGate and WebPass, you will be asked to specify the Access Server and Identity
Server you are using.
Detailed requirements on the OC4J side:
1. Oracle Application Server 10.1.3.x middle-tier installation, with OC4J and Oracle
HTTP Server, including the mod_oc4j Apache mod. Note that this is separate
from the Web server you install on the Oracle Access Manager side, which may or
may not be Oracle HTTP Server.
Using Oracle Access Manager requires Oracle HTTP Server; you cannot use
standalone OC4J.
2. Oracle Access Manager WebGate installed on this Oracle HTTP Server.
3. Additional OC4J instances as needed. Typically, when using Oracle Access
Manager SSO, multiple OC4J instances are used in the topology, so the Oracle
HTTP Server instance must be configured to route and maintain multiple OC4J
instances.
4. Access Manager SDK, one for each OC4J instance, on the same system as OC4J.
The Access Manager SDK is installed independently and is required by OC4J at
runtime to communicate with Access Server. Each OC4J instance communicates
with an Access Manager SDK instance, which has been configured to
communicate with an Access Server instance.
The next section, "Oracle Access Manager Architecture", shows how the Oracle Access
Manager components fit with key components of the Oracle Application Server
middle-tier infrastructure.
Note: Also ensure that the LDAP server you use has the accounts
you will need, as discussed in "Creating Required Accounts in the
LDAP Server" on page 11-16.
This will put you at the Access System Console, used frequently in this chapter.
See Also:
■ Oracle Access Manager System Administration Guide for information
about Oracle Access Manager resource types
See Also:
■ Oracle Access Manager System Administration Guide for information
about Oracle Access Manager plug-ins
See Also:
■ Oracle Access Manager System Administration Guide for information
about the ObSSOCookie
Therefore, when assessing the amount of available space in the HTTP header, take into
account the byte size of the data used by Oracle Access Manager and other
applications. For example, if Oracle Access Manager and other applications combine
to use 1K in the HTTP header, you would have 3K for your data.
See Also:
■ Discussion of how to configure form-based authentication in the
Oracle Access Manager System Administration Guide, particularly the
related appendix
<tr>
<th align="right">Username:</th>
<td align="left"><input type="text" name="usernamevar"></td>
</tr>
<tr>
<th align="right">Password:</th>
<td align="left"><input type="password" name="passwordvar"></td>
</tr>
<tr>
<td align="right"><input type="submit" value="Log In"></td>
<td align="left"><input type="reset"></td>
</tr>
</table>
</form>
</body>
</html>
The action URL for the POST method can be arbitrary, but must match the action URL
you specify when you configure authentication management in Policy Manager in the
next step.
The variable for the user name (usernamevar here) must match what you specify in
the Oracle Access Manager credential_mapping plug-in. The variable for the
password (passwordvar here) must match what you specify in the Oracle Access
Manager validate_password plug-in.
SSL Required: No
Challenge Redirect
Enabled: Yes
You can choose any name and description; here "COREidSSOform" and "COREid SSO
Form Based" are just examples. The challenge parameter specifies
login/login.html as the form because that is the path relative to the Oracle HTTP
Server document root where we created the login page in the previous step. Leave
"Challenge Redirect" blank.
Note that the entries for "creds" here must match the variables specified for user and
password in your login page in the previous step, and these variables are used in the
credential_mapping plug-in and validate_password plug-in, respectively, for
form-based authentication.
Also note that the action URL (/coreid/access/test.html here) can be arbitrary,
but must match the action URL for the POST method in your login page. Protect this
URL with the basic (no password) authentication scheme described in "Configure
Oracle Access Manager Basic Authentication", following shortly.
The value entered for uid (usernamevar here) must match the variable you specified
for the user name in the login form, and when defining form-based authentication in
Policy Manager, shown in previous steps.
This also corresponds to the value of the coreid.name.attribute option in the
Oracle Access Manager login module configuration in OC4J.
See Also:
■ Oracle Access Manager System Administration Guide for more
information about the credential_mapping plug-in
The Oracle Access Manager login module will use this URL to communicate to the
Access Server through the Access Manager SDK.
■ The action URL for the form page, noted in "Create a Login Form" on page 11-8
and "Define Form-Based Authentication in Policy Manager" on page 11-9. This is
so submitted form requests can be intercepted by WebGate in order to enforce
rules for submitted credentials.
(Your application itself, however, must be protected by form-based authentication,
described in "Configure Oracle Access Manager Form-Based Authentication" on
page 11-8.)
These steps define basic authentication, without a password, to protect the resource.
1. Define Basic Authentication in Policy Manager
2. Configure the credential_mapping Plug-In for Basic Authentication
You can choose any name and description; here "COREidSSONoPwd" and
"Authentication without Password" are just examples. The challenge parameter entry
indicated here is one of the choices available from a dropdown list. Leave "Challenge
Redirect" blank.
These are the same entries as for the credential_mapping plug-in for form-based
authentication. The value entered for uid (usernamevar here) must match the user
name variable specified in the login form.
See Also:
■ Oracle Access Manager System Administration Guide for more
information about the credential_mapping plug-in
See Also:
■ "About Oracle Access Manager Resource Types" on page 11-6
You can choose any names for the resource type and resource operation, but you must
use the same names for the coreid.resource.type and
coreid.resource.operation option values in the Oracle Access Manager login
module configuration.
This configuration must be protected using a no-password scheme. Use the basic
scheme that you configured in "Define Basic Authentication in Policy Manager" on
page 11-11.
Choose your resource type (myresourcetype in these examples) from the dropdown
list, then choose the appropriate host name.
The URL prefix must start with a "/" and is the designated URL of the resource type.
This must match the value of the coreid.resource.name option in the Oracle
Access Manager login module configuration.
The description can be anything; "My Description" is just an example.
Note: Do not confuse the URL specified here with the "action URL"
specified when setting up authentication in earlier steps. The two are
separate.
See Also:
■ Oracle Access Manager Installation Guide for information about
installing AccessGate/WebGate
2. Configure each Access Manager SDK to work with the appropriate Access Server.
From Access_SDK_Home/access/oblix/tools/configureAccessGate
directory, run the command configureAccessGate. This utility requires the
Access Server ID, AccessGate ID, and other related parameters.
3. Copy the Oracle Access Manager file jobaccess.jar from the Access Manager
SDK to the OC4J path. You will find this file in the
Access_SDK_Home/AccessServerSDK/oblix/lib directory. Create the
directory ORACLE_HOME/j2ee/home/lib/ext (if it does not already exist) and
copy the jobaccess.jar to that directory.
See Also:
■ Oracle Access Manager Developer Guide for information about
installing the Access Manager SDK
■ Oracle Access Manager System Administration Guide for information
about the configureAccessGate utility
Configure the Access Manager SDK Library Path for Each OC4J Instance
You must configure the java.library.path property for each OC4J instance, in the
ORACLE_HOME/opmn/conf/opmn.xml file, so that the OC4J instance has access to
the Access Manager SDK at runtime. Set the property so that it points to the SDK
location.
For example, on a Windows system:
-Djava.library.path=C:\CoreID\AccessSDK\AccessServerSDK\oblix\lib
This is shown in more detail in the next section, "Configuring opmn.xml for Oracle
Access Manager".
See Also:
■ Oracle Process Manager and Notification Server Administrator’s Guide
for information about OPMN and the opmn.xml file
<ias-component id="OC4J">
<process-type id="home" module-id="OC4J" status="enabled">
<environment>
<variable id="LD_ASSUME_KERNEL" value="2.4.19"/>
<variable id="LD_LIBRARY_PATH"
value="/your_asdk_home/AccessServerSDK/oblix/lib" append="true"/>
</environment>
<module-data>
<category id="start-parameters">
<data id="java-options" value="-server ...
-Djava.library.path=/your_asdk_home/AccessServerSDK/oblix/lib
... />
</category>
...
</module-data>
...
</process-type>
...
</ias-component>
See Also:
■ "Predefined Accounts" on page 4-11
Notes:
■ You do not need an <auth-method> setting in the web.xml file.
Any setting in web.xml would be overridden by the
"COREIDSSO" setting in orion-application.xml.
■ The <jazn-web-app> element is also supported in the
orion-web.xml file. In the event of conflict, orion-web.xml
takes precedence over orion-application.xml for the
particular Web application in question.
See Also:
■ Table 9–5, " Login Module Control Flags" on page 9-17 for
information about <control-flag> settings
<application>
<name>yourappname</name>
<login-modules>
<login-module>
<class>
oracle.security.jazn.login.module.coreid.CoreIDLoginModule
</class>
<control-flag>required</control-flag>
<options>
...
</options>
</login-module>
</login-modules>
</application>
The following sample corresponds to the example that runs throughout "Configure
Oracle Access Manager Form-Based Authentication" on page 11-8, "Configure Oracle
Access Manager Basic Authentication" on page 11-10, and "Configure the Resource
Type" on page 11-12:
<application>
<name>foo</name>
<login-modules>
<login-module>
<class>
oracle.security.jazn.login.module.coreid.CoreIDLoginModule
</class>
<control-flag>required</control-flag>
<options>
<option>
<name>addAllRoles</name>
<value>true</value>
</option>
<option>
<name>coreid.resource.type</name>
<value>myresourcetype</value>
</option>
<option>
<name>coreid.resource.operation</name>
<value>myresourceoperation</value>
</option>
<option>
<name>coreid.resource.name</name>
<value>/myresourceurl</value>
</option>
<option>
<name>coreid.name.attribute</name>
<value>usernamevar</value>
</option>
<option>
<name>coreid.password.attribute</name>
<value>passwordvar</value>
</option>
</options>
</login-module>
</login-modules>
</application>
(This uses all supported options for the Oracle Access Manager login module except
for coreid.name.header and coreid.password.header. Examples for these are
shown later in this chapter.)
WebGate will intercept this request and will check the authentication scheme for this
URL. The configuration shown earlier in this chapter will result in the user being
prompted with the login.html login form from "Create a Login Form" on page 11-8.
Then the following sequence will take place:
1. WebGate will capture the user name and password from the login form and
communicate to Access Server.
2. Access Server will communicate to Oracle Internet Directory (or other LDAP
repository that you use).
3. After the user is authenticated, the Oracle Access Manager SSO token will be
returned to WebGate.
4. WebGate will set the ObSSOCookie and pass the cookie and other HTTP headers
to mod_oc4j, which will route the request to the appropriate OC4J instance.
5. OC4J will take the cookie and validate it, or retrieve roles for the user associated
with this cookie from Access Server using the Access Manager SDK configured on
OC4J.
Important:
■ Ensure that the permission class is in the classpath before you
attempt to grant the permission.
■ Also refer to "Confirming Configured Realm Names for Oracle
Access Manager Principals" on page 11-24.
Notes:
■ The use of OC4J JAAS mode is supported for an application that
uses Oracle Access Manager, in case that is required by your
application in checking authorizations with respect to the
permissions you have granted. Refer to "Introduction to JAAS
Mode" on page 5-5 and "Configuring and Using JAAS Mode" on
page 5-18 to gain an understanding of when and how to use this
mode.
■ For authorization to work properly, also confirm that role
mapping is set up appropriately, to correctly map deployment
roles to J2EE logical roles. Refer to "Mapping Security Roles" on
page 6-10 for additional information.
Important:
■ When using Oracle Access Manager, do not attempt to use the
Admintool addrealm option, which would result in incorrect
realm information in the configuration. (This command is
intended for only the file-based provider.)
■ If you encounter any difficulty, ensure that only the appropriate
realm information is included in any principal names for
permission grants in system-jazn-data.xml.
See Also:
■ "Oracle Access Manager Support and Examples for Web Services"
on page 11-29
Web Application Using HTTP Header Variables through Oracle Access Manager
You can optionally configure a Web application to use HTTP header variables for
authentication. The header variable for user name corresponds to the
coreid.name.header option in the Oracle Access Manager login module
configuration. The header variable for password corresponds to the
coreid.password.header option.
You must execute the following steps to use these header variables:
1. Configure Name and Password in Policy Manager
2. Configure HTTP Header Variables for the Oracle Access Manager Login Module
3. Secure the Web Application That Uses HTTP Headers
See Also:
■ "About Using HTTP Header Variables for Authentication" on
page 11-7
See Also:
■ "Configure the credential_mapping Plug-In for Form-Based
Authentication" on page 11-10 and "Configure the
validate_password Plug-In for Form-Based Authentication" on
page 11-10
■ Oracle Access Manager System Administration Guide for information
about using HTTP header variables
Configure HTTP Header Variables for the Oracle Access Manager Login Module
Include option settings for coreid.name.header and (as appropriate)
coreid.password.header in the Oracle Access Manager login module
configuration in system-jazn-data.xml. In the following example, password
authentication is used. Assume the desired HTTP header variables are
myhttpuservar and myhttppwdvar:
<options>
...
<option>
<name>coreid.name.header</name>
<value>myhttpuservar</value>
</option>
<option>
<name>coreid.password.header</name>
<value>myhttppwdvar</value>
</option>
...
</options>
Configure User Name and Password for the Oracle Access Manager Login Module
Include option settings for coreid.name.attribute and (as appropriate)
coreid.password.attribute in the Oracle Access Manager login module
configuration in system-jazn-data.xml. In the following example, password
authentication is used. Assume the user name and password variables you defined for
the credential_mapping and validate_password plug-ins are usernamevar
and passwordvar:
<options>
...
<option>
<name>coreid.name.attribute</name>
<value>usernamevar</value>
</option>
<option>
<name>coreid.password.attribute</name>
<value>passwordvar</value>
</option>
...
</options>
</application>
See Also:
■ "Configure the Resource Type" on page 11-12 for information
about coreid.resource.type,
coreid.resource.operation, and
coreid.resource.name
See Also:
■ "Oracle Access Manager Examples for J2EE Applications" on
page 11-25
■ Oracle Application Server Web Services Security Guide for general
information about username token, X.509 token, and SAML token
authentication
Web Service with Username Token Authentication for Oracle Access Manager
A username token client uses the user name and password for authentication. You
must configure variables for the user name and password through the Oracle Access
Manager credential_mapping and validate_password plug-ins, with
corresponding settings for the coreid.name.attribute and
coreid.password.attribute options in the Oracle Access Manager login module
See Also:
■ "Configure the Resource Type" on page 11-12 for information
about coreid.resource.type,
coreid.resource.operation, and
coreid.resource.name
Web Service with X.509 Token Authentication for Oracle Access Manager
An X.509 client uses the CN value from the X.509 entry for authentication. You must
configure a variable for the CN user name through the Oracle Access Manager
credential_mapping plug-in, with a corresponding setting for the
coreid.name.attribute option in the Oracle Access Manager login module
configuration, as discussed in "Configure Oracle Access Manager Form-Based
Authentication" on page 11-8.
Do not configure the Oracle Access Manager validate_password plug-in or set the
login module coreid.password.attribute option when X.509 token
authentication is used.
Configure the login module as follows, assuming these settings:
■ X509AppName is the name of the Web service application using X.509 token
authentication.
■ cn_name_var is the variable name for the CN user name, as you define in the
credential_mapping plug-in.
<application>
<name>X509AppName</name>
<login-modules>
<login-module>
<class>
oracle.security.jazn.login.module.coreid.CoreIDLoginModule
</class>
<control-flag>required</control-flag>
<options>
<option>
<name>addAllRoles</name>
<value>true</value>
</option>
<option>
<name>coreid.resource.type</name>
<value>myresourcetype</value>
</option>
<option>
<name>coreid.resource.operation</name>
<value>myresourceoperation</value>
</option>
<option>
<name>coreid.resource.name</name>
<value>/myresourceurl</value>
</option>
<option>
<name>coreid.name.attribute</name>
<value>cn_name_var</value>
</option>
</options>
</login-module>
</login-modules>
</application>
See Also:
■ "Configure the Resource Type" on page 11-12 for information
about coreid.resource.type,
coreid.resource.operation, and
coreid.resource.name
Web Service with SAML Token Authentication for Oracle Access Manager
For a SAML client, OC4J determines the subject name, and you must configure a
variable name for SAML subject authentication through the Oracle Access Manager
credential_mapping plug-in. This credential_mapping setting must be
reflected in the setting of the coreid.name.attribute option in the Oracle Access
Manager login module configuration, as discussed in "Configure Oracle Access
Manager Form-Based Authentication" on page 11-8. OC4J passes the subject name and
credential_mapping variable name to Oracle Access Manager for authentication.
Do not configure the Oracle Access Manager validate_password plug-in or set the
login module coreid.password.attribute option when SAML authentication is
used.
Configure the login module as shown below, assuming these settings:
■ SAMLAppName is the name of the Web service application using SAML token
authentication.
■ subject_name_var is the variable for the subject name, as you define in the
credential_mapping plug-in.
In the SAML scenario, there is also a SAML login module, SAMLLoginModule, that
you must configure along with the CoreIDLoginModule login module, as follows.
This example uses www.example.com for the issuer name.
<application>
<name>SAMLAppName</name>
<login-modules>
<login-module>
<class>
oracle.security.jazn.login.module.saml.SAMLLoginModule
</class>
<control-flag>required</control-flag>
<options>
<option>
<name>addAllRoles</name>
<value>true</value>
</option>
<option>
<name>issuer.name.1</name>
<value>www.example.com</value>
</option>
</options>
</login-module>
<login-module>
<class>
oracle.security.jazn.login.module.coreid.CoreIDLoginModule
</class>
<control-flag>required</control-flag>
<options>
<option>
<name>addAllRoles</name>
<value>true</value>
</option>
<option>
<name>coreid.resource.type</name>
<value>myresourcetype</value>
</option>
<option>
<name>coreid.resource.operation</name>
<value>myresourceoperation</value>
</option>
<option>
<name>coreid.resource.name</name>
<value>/myresourceurl</value>
</option>
<option>
<name>coreid.name.attribute</name>
<value>subject_name_var</value>
</option>
</options>
</login-module>
</login-modules>
</application>
See Also:
■ "Configure the Resource Type" on page 11-12 for information
about coreid.resource.type,
coreid.resource.operation, and
coreid.resource.name
■ Oracle Application Server Web Services Security Guide for
information about the SAMLLoginModule
See Also:
■ "Troubleshooting Login to Oracle Application Server SOA
Applications" on page 11-25
You can use a basic usage model (without OC4J integration) or a usage model with
OC4J integration that allows your code to be portable.
See Also:
■ Oracle Containers for J2EE User and Role Java API Reference (Javadoc)
specifies methods to get and set any of these common properties, as well as the
more general methods getProperty(), getProperties(), setProperty(),
and setProperties(). The setProperty() and setProperties() methods
take instances of the oracle.security.idm.ModProperty class (described
below).
■ UserManager: A UserManager instance is used to manage the user population
within the repository, including the execution of operations involving users. This
includes creating, authenticating, or dropping a user.
There are the following interfaces for roles in the identity repository:
■ Role: A Role instance represents a role in the identity store. This is a subinterface
of Identity, and specifies a method to get a role profile. It is also a
superinterface of RoleProfile.
■ RoleProfile: A RoleProfile instance represents detailed information about a
role. This is a subinterface of Role, and specifies methods to add, remove, or get
owners of the role; get all the grantees that are directly or indirectly granted the
role; and determine whether this is an application role or an enterprise role.
■ RoleManager: A RoleManager instance is used to manage the role population
within the repository, including the execution of operations involving roles. This
includes creating a role, dropping a role, granting a role to a specified principal, or
revoking a role from a specified principal.
See Also:
■ "Example: Basic User and Role API Framework" on page 12-8 for
the complete sample code
■ "Step by Step: OC4J Integration Usage Model" on page 12-6 for
features that allow you to make your code portable
SimpleSearchFilter sf = oidStore.getSimpleSearchFilter(
UserProfile.NAME, SimpleSearchFilter.TYPE_EQUAL, null);
// generate the search parameter instance and set the search filter
SearchParameters params = new SearchParameters();
params.setFilter(sf);
See Also:
■ "Example: OC4J Integration with User and Role API Framework"
on page 12-9 for the complete sample code
The properties file contains settings required by the framework to access OC4J
login module information. The properties file format is shown in "User and Role
Properties File" on page 12-8.
2. Creating the IdentityStoreFactory instance is a privileged operation and
must be carried out within an AccessController.doPrivileged() block, as
follows:
IdentityStoreFactory factory = null;
try
{
factory = (IdentityStoreFactory) AccessController.doPrivileged(
new PrivilegedExceptionAction()
{
public Object run() throws IMException
{
IdentityStoreFactoryBuilder builder =
new IdentityStoreFactoryBuilder();
return builder.getIdentityStoreFactory();
}
});
}catch (PrivilegedActionException e)
{
e.getException().printStackTrace(out);
}
catch (Exception e)
{
e.printStackTrace(out);
}
Be aware that in order to use Java 2 policies, you must specifically enable a security
manager, as discussed in "Specifying a Java 2 Security Manager and Policy File" on
page 5-1.
# This property specifies the JMX Mbean URL for the OC4J container in which the
# application is deployed.
# For OPMN-managed OC4J, uncomment the URL that follows; comment out all others.
# format: service:jmx:rmi:///opmn://opmnhost[:opmnport]/oc4jInstance
jmxserviceurl=service:jmx:rmi:///opmn://localhost:6008/home
# For standalone OC4J, uncomment the URL that follows; comment out all others.
# format: service:jmx:rmi:///opmn://oc4jhost:rmiport/oc4jContextRoot
#jmxserviceurl=service:jmx:rmi://localhost:23791/oc4j/
See Also:
■ Oracle Containers for J2EE Developer’s Guide for information about
setting the JMX Service URI for an OPMN-managed or standalone
OC4J instance
try
{
java.util.logging.Level.ALL);
oidFactory = builder.getIdentityStoreFactory(
"oracle.security.idm.providers.oid.OIDIdentityStoreFactory",
factEnv);
}catch (IMException e)
{
e.printStackTrace();
}
}
}
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>UserSearch</title></head>");
out.println("<body>");
out.println(
"<label for=\"fld\"><b>User name begining with</b></label>");
out.println(
"<form action=\"usersearch\">"+
"<P><select name=\"searchtype\" size=\"1\">"+
"<option value=\"usersearch\">Search Users</option>"+
"<option value=\"rolesearch\">Search Roles</option>"+
"<option value=\"membershipsearch\">Search Membership details"+
"<option value=\"membersearch\">Searchs Members of role"+
"</option></select></P>"+
"<input name=\"name\" id=\"fld\" value=\""
+ filter +
"\"type=\"text\"/><input type=\"SUBMIT\" value=\"Search\"/></form>");
out.println("<br><br><br>");
out.println("</body></html>");
out.close();
}
try
{
factory = (IdentityStoreFactory) AccessController.doPrivileged(
new PrivilegedExceptionAction()
{
public Object run() throws IMException
{
IdentityStoreFactoryBuilder builder =
new IdentityStoreFactoryBuilder();
return builder.getIdentityStoreFactory();
}
});
store = factory.getIdentityStoreInstance();
}catch (PrivilegedActionException e)
{
e.getException().printStackTrace(out);
}
catch (Exception e)
{
e.printStackTrace(out);
}
}
try {
Role rle = store.searchRole(IdentityStore.SEARCH_BY_NAME, name);
out.println("Members of role \""+rle.getName()+
"\" are:<br>");
SearchResponse resp =
rle.getRoleProfile().getGrantees(null, false);
while (resp.hasNext()) {
Identity idy = resp.next();
out.println("Unique name: " + idy.getUniqueName() + "<br>");
}
} catch (IMException e) {
e.printStackTrace(out);
}
}
try {
User usr = store.searchUser(name);
out.println("Membership details for user \""+usr.getName()+
"\" are:<br>");
SearchResponse resp =
store.getRoleManager().getGrantedRoles(usr.getPrincipal(), false);
while (resp.hasNext()) {
Identity idy = resp.next();
out.println("Unique name: " + idy.getUniqueName() + "<br>");
}
} catch (IMException e) {
e.printStackTrace(out);
}
}
try {
SimpleSearchFilter sf = store.getSimpleSearchFilter(
RoleProfile.NAME, SimpleSearchFilter.TYPE_EQUAL, null);
sf.setValue(name + sf.getWildCardChar());
} catch (IMException e) {
e.printStackTrace(out);
}
}
try {
SimpleSearchFilter sf = store.getSimpleSearchFilter(
UserProfile.NAME, SimpleSearchFilter.TYPE_EQUAL, null);
sf.setValue(name + sf.getWildCardChar());
} catch (IMException e) {
e.printStackTrace(out);
}
}
}
Notes:
■ Note that by convention, the <jazn> setting provider="XML" is
used with the pluggable identity management framework.
■ If you use any identity repository other than the file-based
provider or Oracle Internet Directory, you must define an
administrative user account and administrator roles, grant the
roles to the user, and grant necessary permissions to the roles, as
discussed in "Creating the Administrative User and Roles and
Granting RMI Permission" on page 10-9.
4. Once the identity has been validated, the token asserter returns user information
to OC4J through an identity callback handler, which it constructs. At this point, the
identity passed in the callback handler is a trusted identity. The callback handler
may be constructed simply by passing in an identity string, or an identity string
and request object, for example.
5. OC4J passes the identity callback handler with user information to the login
module configured for the application. The login module constructs appropriate
callback types to handle user information, and passes them to the identity callback
handler through the callback handler handle(Callback[]) method (standard
login module functionality). The login module collects principals for the user, such
as for roles the user belongs to, by retrieving information from the third-party
identity management system as necessary. The login module then sends a
populated subject to OC4J.
Note that because the identity has already been validated by the token asserter,
there is no need for the login module to perform authentication again. Also note
that a custom login module for the identity management framework must be able
to handle an identity callback handler.
Alternative: Instead of implementing and configuring a login module for the
application, you can provide a token asserter that creates the subject and
implements the getSubject() method to return the subject (populated with
user roles) directly to OC4J, without a login module. If you choose this option,
there is an identity management framework property
(idm.subject.loginmodule.disabled) that you must set accordingly.
6. A subject asserter can optionally validate the subject propagated by the login
module. For example, you may want to sign and verify subject principals to
protect the authenticity of the principals.
Oracle supplies Java interfaces for these components, which you can implement as
appropriate to integrate a third-party identity management system with OC4J.
An administrator must configure OC4J to reference the implementation classes to use,
and configure the login module.
Note: The token asserter and login module may access different
backend identity systems. For example, the token asserter may access
an identity management system in order to validate the identity, while
the login module may access a separate identity store, such as a
database, containing additional application-specific information about
the user, such as user groups or roles. This additional information can
be included in the subject that is populated for the user. (An identity
store is a repository, such as a directory or database, that contains user
information.)
See Also:
■ "JAAS Authentication: Login Modules" on page 2-13
■ "Identity Management Framework Programmatic Interfaces" on
page 13-5
■ "Identity Management Framework Configuration" on page 13-13
See Also:
■ "Identity Management Framework Programmatic Interfaces" on
page 13-5
2. An administrator configures the appropriate login module (or optionally uses the
default login module, RealmLoginModule). Configuration is stored under the
<jazn-loginconfig> element in system-jazn-data.xml.
3. For any application to use the framework, the application assembler specifies the
authentication method CUSTOM_AUTH in the orion-application.xml file
packaged with the application.
See Also:
■ "Identity Management Framework Configuration" on page 13-13
Notes:
■ The identity management framework is driven by your
configuration of the implementation classes you choose to use or
provide.
■ For any class implementations you supply yourself, we
recommend that you package them in a single JAR file that you
deploy as an OC4J shared library. (Refer to "Tasks to Share a
Library" on page 6-14.)
See Also:
■ Oracle Containers for J2EE Security Java API Reference for Javadoc
that includes the identity management framework APIs
The integer reason is a code specified by OC4J that indicates why the failure
occurred, and is one of the following values (defined in the class
oracle.security.jazn.collector.IdmErrorConstants):
– REASON_CHALLENGE_USER: The user is not authenticated, but can be
prompted for authentication (401 error in the browser). This is typically for
basic authentication, where the browser will bring up the authentication
window again. The value of this constant is 1.
– REASON_INVALID_USER: The user is not authenticated, for example due to
invalid credentials (401 error). The value of this constant is 1.
– REASON_UNAUTHORIZED: The user is authenticated, but not authorized to
access the protected resource (403 error). The value of this constant is 2.
– REASON_PRECLUDED_ACCESS: The resource is protected by a security
constraint that contains no roles (403 error). The value of this constant is 3.
Oracle supplies the following TokenCollector implementation:
oracle.security.jazn.collector.oc4j.TokenCollectorImpl
This implementation is an abstract class that supports the use of an HTTP cookie or
HTTP header for the identity token. If either of these is what you want to use, then you
can extend TokenCollectorImpl and add appropriate error handling in the
fail() method (such as redirecting the user to the login page, for example).
The getToken() method of TokenCollectorImpl returns the appropriate token
type according to your configuration—either HttpCookieIdentityToken or
HttpHeaderIdentityToken.
To use the HTTP request object itself instead of a cookie or header, you must
implement a custom token collector.
A token collector uses the constructor of the appropriate identity token class to create
the token. The HttpCookieIdentityToken, HttpHeaderIdentityToken, and
HttpRequestIdentityToken constructors are documented in "Identity Token
Interface and Oracle Implementations" on page 13-6.
See Also:
■ "Identity Token Interface and Oracle Implementations" on
page 13-6 for information about the IdentityToken interface,
HttpCookieIdentityToken implementation,
HttpHeaderIdentityToken implementation,
HttpRequestIdentityToken implementation, and related
methods and constructors
Identity Callback
Oracle supplies an identity callback class for use with the identity management
framework:
oracle.security.jazn.callback.IdentityCallback
You can use an IdentityCallback instance to obtain the identity itself, as well as
the authentication state of the identity (whether it has been authenticated) and the
authentication method used to authenticate it.
The constructor takes no parameters:
IdentityCallback()
You can then use the identity callback handler handle() method to set an identity
callback into the callback handler.
// In token asserter:
IdentityCallbackHandler ich = new IdentityCallbackHandlerImpl("identity");
...
// In login module:
IdentityCallback icb = new IdentityCallback();
Callback[] callback = {icb};
ich.handle(callback);
// In login module:
HttpRequestCallback httpreqcb = new HttpRequestCallback();
Callback[] callback = {httpreqcb};
ich.handle(callback);
Notes:
■ It is not required to use a custom login module with the identity
management framework. For the file-based provider or Oracle
Identity Management, RealmLoginModule will suffice. For
supported external LDAP providers (Active Directory and Sun
Java System Directory Server), LDAPLoginModule will suffice.
■ You can avoid using any login module if you instead implement a
token asserter that accesses the identity management system,
populates the subject itself, and implements the getSubject()
method. If you choose this alternative, the identity management
framework property idm.subject.loginmodule.disabled
must be set accordingly.
See Also:
■ "JAAS Authentication: Login Modules" on page 2-13
Note: The shared library feature is the preferred way to make a JAR
file available to OC4J applications, but alternatively you can put the
JAR file into the following directory:
ORACLE_HOME/j2ee/home/lib/ext
Important:
■ By default, the identity management framework is configured to
use Java SSO (discussed in Chapter 14, "OC4J Java Single
Sign-On").
■ If you associate an OC4J instance with an Oracle Internet
Directory instance, the <jazn> element configuration in the
jazn.xml file of the OC4J home instance is rewritten and any
previous settings are lost.
■ For an installation of the OC4J 10.1.3.1 patch over an existing
10.1.3.0.0 installation (as opposed to a fresh 10.1.3.1 installation),
any default configurations are not in place—the properties are not
referenced in jazn.xml. In this case, you should manually add
the above configuration to jazn.xml.
<application>
<name>myapp</name>
<login-modules>
<login-module>
<class>mypackage.CustomLM</class>
<control-flag>required</control-flag>
<options>
<option>
<name>addAllRoles</name>
<value>true</value>
</option>
</options>
</login-module>
</login-modules>
</application>
</jazn-loginconfig>
See Also:
■ Chapter 9, "Login Modules"
Notes:
■ The <jazn-web-app> element is also supported in the
orion-web.xml file, as a subelement of <orion-web-app>, for
a particular Web application. A setting there overrides the
orion-application.xml setting for that Web application.
■ An authentication method setting in orion-application.xml
(or orion-web.xml) overrides any authentication method
setting in web.xml.
See Also:
■ For additional information about OC4J group features, the topic
"Group OC4J Instances Page" in the Application Server Control
online help
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import oracle.security.jazn.collector.CollectorException;
import oracle.security.jazn.collector.oc4j.TokenCollectorImpl;
import oracle.security.jazn.token.HttpHeaderIdentityToken;
import oracle.security.jazn.token.IdentityToken;
import oracle.security.jazn.token.TokenNotFoundException;
import oracle.security.jazn.collector.IdmErrorConstants;
TokenNotFoundException {
if (null == tokenType || 0 == tokenType.length() ||
!IdentityToken.HTTP_HEADER.equalsIgnoreCase(tokenType)) {
throw new CollectorException("invalid token type" + tokenType);
}
HttpHeaderIdentityToken identityToken =
(HttpHeaderIdentityToken)super.getToken(tokenType,
request,
tokenNames,
properties);
Map m = identityToken.getHeaderValues();
if (m == null || m.size() == 0) {
throw new TokenNotFoundException("no HTTP Header token was found");
}
return identityToken;
}
import java.util.Map;
import java.util.Properties;
import oracle.security.jazn.asserter.AsserterException;
import oracle.security.jazn.asserter.TokenAsserter;
import oracle.security.jazn.callback.IdentityCallbackHandler;
import oracle.security.jazn.callback.IdentityCallbackHandlerImpl;
import oracle.security.jazn.token.IdentityToken;
import oracle.security.jazn.token.HttpHeaderIdentityToken;
Map m = token.getHeaderValues();
if (m != null && m.size() > 0) {
String user = (String) m.get(HEADER_NAME);
if ("ANONYMOUS".equalsIgnoreCase(user)) {
throw new AsserterException
("anon user - expected authenticated user");
}
IdentityCallbackHandler idcb =
new IdentityCallbackHandlerImpl(user);
idcb.setIdentityAsserted(true);
idcb.setAuthenticationType(AUTH_TYPE);
return idcb;
}
else {
throw new AsserterException
("not a valid token - no identity to assert");
}
}
}
}
The OC4J 10.1.3.1 implementation packages an alternative Java single sign-on solution
that does not rely on additional required infrastructure like other Oracle Application
Server single sign-on products. This Java SSO, based on the OracleAS JAAS Provider
identity management framework discussed in Chapter 13, can be used across Web
applications in any of the following deployment scenarios:
■ Web applications are deployed in the same application EAR file.
■ Web applications are deployed in different application EAR files in the same OC4J
instance.
■ Web applications are deployed in different application EAR files in different OC4J
instances, where the Web applications share a common security domain and
cookie domain.
■ A single application EAR file, including Web applications, is deployed into
multiple OC4J instances within an OC4J cluster.
This chapter documents OC4J Java SSO, covering the following topics:
■ Overview of OC4J Java SSO
■ Java SSO Setup and Configuration
■ Java SSO APIs
■ Summary of How to Use Java SSO
■ Troubleshooting Java SSO
Notes:
■ If you use any identity store other than the file-based provider or
Oracle Internet Directory, you must define an administrative user
account and administrative roles, grant the roles to the user, and
grant necessary permissions to the roles, as discussed in "Creating
the Administrative User and Roles and Granting RMI Permission"
on page 10-9.
■ This upgrades and replaces the functionality of the "Lightweight
J2EE Single Sign-On" feature documented for Oracle Application
Server 10g Release 2 (10.1.2). That feature is desupported.
1. A user, through the browser, attempts to access a protected URL for application
App1.
2. There is a redirect to javasso (more specifically, the SSOLogin servlet) through
the browser.
3. The App1 URL is passed to javasso.
4. Through javasso functionality, the user is prompted with the Java SSO login
page.
5. The user supplies the user name and password.
6. Through javasso functionality, the user is authenticated according to
information in the identity store. After the user is successfully authenticated, the
SSOLogin servlet maps the authenticated identity to the Java SSO cookie (identity
token), then uses a symmetric key cipher to sign and encrypt the contents of the
cookie.
7. There is a redirect to App1 through the browser, and the secured cookie is sent
back to the client.
8. The user accesses the content of App1.
9. The user attempts to access a protected URL for application App2, and is able to
access the content of App2 without authentication.
Browser
1 2 8 3 4 5 7 9
Identity Store
■ SOA installation with two OC4J instances, using the file-based provider
The Oracle BPEL Process Manager (the Business Process Execution Language
engine) and OWSM (Oracle Web Services Manager) run on the OC4J_SOA
instance. The javasso application, customer applications, and Application Server
Control run on the OC4J_Home instance.
The system-jazn-data.xml file (file-based provider) must be synchronized
between the two instances, as discussed in "Considerations with the File-Based
Provider and Two OC4J Instances" on page 14-15.
■ SOA installation with two OC4J instances, using Oracle Internet Directory
The Oracle BPEL Process Manager and OWSM run on the OC4J_SOA instance.
The javasso application, customer applications, and Application Server Control
run on the OC4J_Home instance.
A single Oracle Internet Directory instance is used as the security provider.
■ High-availability installation with multiple OC4J instances, using Oracle Internet
Directory
The javasso application and all customer applications are available on all
instances.
A single Oracle Internet Directory instance is used as the security provider.
Notes:
■ Partner applications (either Oracle Application Server console
applications or customer applications) can be split between OC4J
instances however desired, but scenarios such as the above are
typical.
■ Customers using Oracle Internet Directory within a full Oracle
Identity Management environment would typically use Oracle
Single Sign-On instead of Java SSO, but there may be situations
where Java SSO with Oracle Internet Directory is useful.
(Be sure the cookie domain is set properly, as discussed in the troubleshooting
section, "Returned to Java SSO Login Page Despite Correct Credentials" on
page 14-19.)
3. The partner applications using Java SSO must all be configured to use the same
security provider and same identity store as the javasso application. (In
particular, when using the file-based provider, use the same repository file. For a
scenario with multiple OC4J instances, see "Considerations with the File-Based
Provider and Two OC4J Instances" on page 14-15.) By default, javasso is
configured to use the file-based provider, but you can change this using the
Application Server Control Console.
For partner applications that are customer applications, you can configure the
security provider during deployment. For Application Server Control itself, there
are special steps in Application Server Control Console to change the security
provider. For other Oracle Application Server console applications that you want
to include, if changes are necessary they can be handled similarly to changing the
security provider for javasso.
4. Each partner application must be enabled to use Java SSO. This can also be
configured through Application Server Control . Being enabled to use Java SSO is
indicated by a setting of auth-method="CUSTOM_AUTH" in the
<jazn-web-app> element, a subelement of <jazn> in
orion-application.xml.
Localization Support for the Java SSO Login Page and Error Pages
The Java SSO login page and error pages shipped with OC4J support localization.
Content displayed by these pages is localized according to the browser settings.
■ Repackage and redeploy the javasso.ear file with the customized files.
■ The URL for the Java SSO SSOLogin servlet (corresponding to the
custom.sso.url.login property). If you have multiple hosts, use the fully
qualified domain name.
■ The URL for the Java SSO SSOLogout servlet (corresponding to the
custom.sso.url.logout property). If you have multiple hosts, use the fully
qualified domain name.
■ The session timeout in seconds (corresponding to the
custom.sso.session.timeout property). Note that this is a hard timeout, not
an inactivity timeout. The session will timeout after this amount of time no matter
what.
■ The number of login attempts to allow (corresponding to the
custom.sso.login.attempts property).
If Java SSO has not yet been properly configured, use Configure Java SSO, after
setting any of the above parameters as appropriate, to configure it. This will
automatically generate a new symmetric key.
To reconfigure Java SSO after it has been properly configured, there is a checkbox to
specify whether a new symmetric key should be generated when you apply the
reconfiguration. You should generate a new key in either of the following
circumstances:
■ If an error condition has arisen where different OC4J instances may be using
different keys. All instances must use the same key.
■ If you want a new key just to be cautious from a security standpoint. (We
recommend that you do this on a regular basis.)
Choose Apply (which appears in place of Configure Java SSO), after setting any of
the above parameters as appropriate, to apply the reconfiguration and generate the
key (as applicable).
Settings are reflected in <property> subelements under the <jazn> element in the
jazn.xml file. In a cluster, these settings and the key apply across all OC4J instances.
Important:
■ When using the 10.1.3.1 patch set (as opposed to a fresh 10.1.3.1
installation), default jazn.xml settings shown in "Default Java
SSO Property Settings for Single-Instance OC4J Installations" on
page 14-14 will not be present. Add these settings manually before
configuring Java SSO.
■ By default, the jazn.xml file has a dummy value for the key (in
the custom.sso.key.alias setting) until you configure Java
SSO.
■ All applications configured to use the same Java SSO should share
a single key. (This is a potential issue only in a scenario with
multiple OC4J instances.)
■ You must restart OC4J instances for these changes to take effect.
You will be notified and prompted to do so.
■ If you will be using Oracle Identity Management, make Java SSO
settings after associating the OC4J instance with the Oracle
Internet Directory instance. When you do the association, the
<jazn> element configuration in the jazn.xml file of the OC4J
home instance is rewritten and any previous settings are lost.
Notes:
■ You must restart the application for a change in security provider
to take effect.
■ Where there are multiple OC4J instances and not all javasso
applications have the same security provider, there is a Change
Security Provider option relating to the javasso application for
each OC4J instance on the Java SSO Instances and Properties page
in the Application Server Control Console. This simplifies the
process of configuring the javasso application you want to use.
Each type of security provider necessitates its own set of configuration tasks,
documented in the following locations:
Important:
■ If you will be using Oracle Identity Management as the security
provider for an application, configure that before enabling the
application for Java SSO. When you switch from the file-based
provider to Oracle Identity Management through Application
Server Control at any time for any partner application, the
<jazn> element in orion-application.xml for the
application is replaced with the following. Any previous setting to
enable the application for Java SSO (the CUSTOM_AUTH setting)
will be lost and must be redone.
<jazn provider="LDAP" />
■ You must restart OC4J instances for these changes to take effect.
You will be notified and prompted to do so.
■ If you have multiple hosts, use the fully qualified domain name
when invoking partner applications from your browser.
See Also:
■ "Set Java SSO Properties and Generate the Symmetric Key" on
page 14-8
<!-- properties for the out of the box Java SSO -->
<property name="custom.sso.url.login" value="/jsso/SSOLogin" />
<property name="custom.sso.url.logout" value="/jsso/SSOLogout" />
<property name="custom.sso.key.alias" value="ssoSymmetricKey" />
</jazn>
Important:
■ These settings do not exist by default in some scenarios, as noted
in "General Considerations for Multiple OC4J Instances" on
page 14-16 and "Considerations When Using the 10.1.3.1 Patch
over 10.1.3.0.0" on page 14-17. In these cases, manually add the
default configuration to jazn.xml before configuring Java SSO.
■ By default, there is a dummy value for the key in the
custom.sso.key.alias setting (as shown above) until you
configure Java SSO through Application Server Control, as
discussed in "Set Java SSO Properties and Generate the Symmetric
Key" on page 14-8. Once you configure Java SSO, the setting will
change to something like the following:
value="{AES-128}IdG4OPSqGPJ8hZFPn1W4Uw=="
This triggers usage of Java SSO and its implementation of the identity management
framework according to configuration in jazn.xml.
Notes:
■ Notice that because the OC4J default configuration specifies Java
SSO as the identity management framework implementation,
enabling a partner application to use the identity management
framework (auth-method="CUSTOM_AUTH") enables it to use
Java SSO.
■ The <jazn-web-app> element is also supported in the
orion-web.xml file, as a subelement of <orion-web-app>, for
a particular Web application. A setting there overrides the
orion-application.xml setting for that Web application.
■ An authentication method setting in orion-application.xml
(or orion-web.xml) overrides any authentication method
setting in web.xml.
See Also:
■ "Configuring an Application to Use the Identity Management
Framework" on page 13-15
■ They would like to activate Java SSO in OC4J_HOME and deploy SOA applications
in OC4J_SOA.
■ They would like to use the file-based provider in both OC4J_HOME and
OC4J_SOA.
By default, each OC4J instance is configured with its own file-based provider, the
system-jazn-data.xml file. For Java SSO to work correctly across both instances,
however, user accounts and user roles must be synchronized across the two
system-jazn-data.xml files. Using OC4J group functionality, the following steps
make this possible:
1. Create an OC4J group for Java SSO—JSSO_GROUP, for example. Refer to "OC4J
Basic Group Features" on page 7-17.
2. Start the Java SSO application in OC4J_HOME after making sure it is configured to
use the file-based provider, system-jazn-data.xml, which is its default setting.
(Note that the Java SSO application should be started in only one OC4J instance in
this sample use case.)
3. Deploy the J2EE applications that are to use Java SSO to the OC4J_SOA instance;
configure each application to use the file-based provider; and enable Java SSO for
each application.
4. Add OC4J_HOME and OC4J_SOA as members of JSSO_GROUP. Again refer to
"OC4J Basic Group Features".
For ongoing user and role administration for these applications, the customer would
use the OC4J J2EEServerGroup MBean that corresponds to JSSO_GROUP, executing
appropriate security provider MBean operations. This MBean will ensure
synchronization of user accounts and roles across the JSSO_GROUP members. Refer to
"Cluster MBean Browser Features and the J2EEServerGroup MBean" on page 7-18.
See Also:
■ For additional information about OC4J group features, the topic
"Group OC4J Instances Page" in the Application Server Control
online help
See Also:
■ For additional information about OC4J group features, the topic
"Group OC4J Instances Page" in the Application Server Control
online help
See Also:
■ Oracle Containers for J2EE Security Java API Reference for Javadoc
that includes the Java SSO APIs
Supply the HTTP response object that corresponds to the request being processed,
and specify the URL where the application is to be redirected after logout. The
application is first directed to the Java SSO SSOLogout servlet, which unsets the
Java SSO cookie, and then to the specified target URL.
For example:
JSSOUtil.logout(response, "http://portal.acme.com");
Important: If you have multiple hosts, use the fully qualified domain
name when invoking partner applications from your browser.
Or you can choose Test Login URL from the Application Server Control page where
you configure Java SSO properties.
If you are redirected to the host:port top-level page, then the test is successful.
Instructions for starting the javasso application are in "Start the javasso Application"
on page 14-8.
Notes:
■ Secure communication between a client and Oracle HTTP
Server is independent of secure communication between Oracle
HTTP Server and OC4J.
■ This chapter assumes some prior knowledge of security and
SSL concepts.
See Also:
■ "Transport-Level Security" on page 1-3 (overview)
■ Oracle HTTP Server Administrator’s Guide for related information
about using SSL with Oracle HTTP Server
■ Oracle Application Server Administrator’s Guide for information
about configuring additional Oracle Application Server
components to take advantage of SSL
HTTP
Client OC4J
HTTP Apache JServ
Protocol
mod_oc4j WebApp A1
Java Plug-in
mod_ossl servlet servlet
s1 s2
Using Keys and Certificates with OC4J and Oracle HTTP Server
The steps below describe using keys and certificates for SSL communication in OC4J.
These are server-level steps, typically executed prior to deployment of an application
that will require secure communication, perhaps when you first set up an Oracle
Application Server instance.
Note that a keystore stores certificates, including the certificates of all trusted parties,
for use by an application. Through its keystore, an entity such as OC4J (for example)
can authenticate other parties, as well as authenticate itself to other parties. Oracle
HTTP Server uses what is called a wallet for the same purpose.
In Java, a keystore is a java.security.KeyStore instance that you can create and
manipulate using the keytool utility that is provided with the Sun Microsystems
JDK. The underlying physical manifestation of this object is a file.
The Oracle Wallet Manager has functionality for Oracle wallets that is equivalent to
the functionality of keytool for keystores.
Notes:
■ A keystore or wallet must include a private key, a public key, and
a trusted certificate (such as a CA certificate) in order to be used in
establishing trust relationships.
■ OC4J comes with a default wallet that does not include a trusted
certificate. You should create and provision your own wallet
instead of using the default wallet.
See Also:
■ For information about keytool:
http://java.sun.com/j2se/1.3/docs/tooldocs/win32/keyto
ol.html
Here are the steps at the OC4J end for using certificates between OC4J and Oracle
HTTP Server:
1. Use keytool to generate a private key, public key, and unsigned certificate.You
can place this information into either a new keystore or an existing keystore.
2. Obtain a signature for the certificate, using either of the following two approaches.
Generate your own signature:
a. Use keytool to "self-sign" the certificate. This is appropriate if your clients
trust you as, in effect, your own certificate authority.
Alternatively, obtain a signature from a recognized certificate authority:
a. Using the certificate from Step 1, use keytool to generate a certificate request,
which is a request to have the certificate signed by a certificate authority.
b. Submit the certificate request to a certificate authority (such as Verisign or
Thawte; links following shortly).
c. Receive the signature from the certificate authority and import it into the
keystore, again using keytool. In the keystore, the signature is matched with
the associated certificate.
See Also:
■ Oracle Application Server Certificate Authority Administrator’s Guide
for information about OCA
The process for requesting and receiving signatures is up to the particular certificate
authority you use. Because that is outside the scope and control of Oracle Application
Server, this document does not cover it. You can go to the Web site of any certificate
authority for information. (Any browser should have a list of trusted certificate
authorities.) Here are the Web addresses for VeriSign, Inc. and Thawte, Inc., for
example:
http://www.verisign.com/
http://www.thawte.com/
For SSL communication between OC4J and Oracle HTTP Server, at the Oracle HTTP
Server end you must execute the following steps as necessary.
1. Execute steps equivalent to the preceding steps for OC4J, but using a wallet and
Oracle Wallet Manager instead of a keystore and the keytool utility.
2. As appropriate: If the OC4J certificate is signed by an entity that Oracle HTTP
Server does not yet trust, obtain the certificate of the entity and import it into
Oracle HTTP Server. The specifics depend on whether the OC4J certificate in
question is self-signed, as follows.
If OC4J has a self-signed certificate (essentially, Oracle HTTP Server does not yet
trust OC4J):
a. From OC4J, use keytool to export the OC4J certificate. This step places the
certificate into a file that is accessible to Oracle HTTP Server.
b. From Oracle HTTP Server, use Oracle Wallet Manager to import the OC4J
certificate.
Alternatively, if OC4J has a certificate that is signed by another entity (that Oracle
HTTP Server does not yet trust):
a. Obtain the certificate of the entity in any appropriate way, such as by
exporting it from the entity. The exact steps vary, depending on the entity.
b. From Oracle HTTP Server, use Oracle Wallet Manager to import the certificate
of the entity.
3. As appropriate: If the Oracle HTTP Server certificate is signed by an entity that
OC4J does not yet trust, and OC4J is in a mode of operation that requires client
authentication:
(This is discussed in "Requesting Client Authentication" on page 15-15.)
a. Obtain the certificate of the entity in any appropriate way, such as by
exporting it from the entity. The exact steps vary, depending on the entity.
b. From OC4J, use keytool to import the certificate of the entity.
In this tool:
■ The keystore option sets the filename where the keys are stored.
■ The storepass option sets the password for protecting the keystore. You can
optionally omit this from the command line and be prompted for a password
instead.
The keytool prompts you for additional information, as follows:
What is your first and last name?
[Unknown]: Test User
What is the name of your organizational unit?
[Unknown]: Support
What is the name of your organization?
[Unknown]: Oracle
What is the name of your City or Locality?
[Unknown]: Redwood Shores
What is the name of your State or Province?
[Unknown]: CA
What is the two-letter country code for this unit?
[Unknown]: US
Is <CN=Test User, OU=Support, O=Oracle, L=Redwood Shores, ST=CA, C=US> correct?
[no]: yes
Always press RETURN for the key password. In OC4J 10.1.3.x implementations, the
keystore password must be the same as the key entry password.
The mykeystore file is created in the current directory. The default alias of the
key is mykey.
See Also:
■ For detailed information about the keytool utility:
http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/k
eytool.html
Here is an example:
<?xml version="1.0"?>
<web-site display-name="OC4J 10g Secure Web Site" protocol="http"
port="4443" secure="true">
<ssl-config keystore="./roadrunner.jks" keystore-password="welcome1" />
<default-web-app application="default" name="defaultWebApp" root="/" />
<web-app application="SSLDemos-Project1-WS" name="WebServices"
load-on-startup="true" root="/SSLDemos-Project1-context-root" />
<access-log path="../log/default-web-access2.log" split="day" />
</web-site>
This step sets up a mode where OC4J accepts or rejects a client entity for secure
communication according to its identity. The needs-client-auth attribute
instructs OC4J to request the client certificate chain upon connection. If the root
certificate of the client is recognized, then the client is accepted.
The keystore specified in the <ssl-config> element must contain the certificates
of any clients that are authorized to connect to OC4J through HTTPS.
2. Specify each application in the Web site as shared. The shared attribute of the
<web-app> element indicates whether multiple bindings (different Web sites, or
ports, and context roots) can be shared. Supported values are "true" and
"false" (default).
Sharing implies the sharing of everything that makes up a Web application,
including sessions, servlet instances, and context values. A typical use for this
mode is to share a Web application between an HTTP site and an HTTPS site at the
same context path, when SSL is required for some but not all of the
communications. Performance is improved by encrypting only sensitive
information, rather than all information.
If an HTTPS Web application is marked as shared, then instead of using the SSL
certificate to track the session, the cookie is used to track the session. This is
beneficial in that the SSL certificate uses 50K to store each certificate when tracking
it, which sometimes results in an "out of memory" problem for the session before
the session times out. This could possibly make the Web application less secure,
but might be necessary to work around issues such as SSL session timeouts not
being properly supported in some browsers.
See Also:
■ Oracle Containers for J2EE Configuration and Administration Guide
for more information about sharing Web applications between
Web sites
3. Set the cookie domain if shared="true" and the default ports are not used.
When the client interacts with a Web server over separate ports, the cookie
believes that each separate port denotes a separate Web site. If you use the default
ports of 80 for HTTP and 443 for HTTPS, the client recognizes these as two
different ports of the same Web site and creates only a single cookie. However, if
you use nondefault ports, the client does not recognize these ports as part of the
same Web site and will create separate cookies for each port, unless you specify
the cookie domain.
Cookie domains track the client’s communication across multiple servers within a
DNS domain. If you use nondefault ports for a shared environment with HTTP
and HTTPS, set cookie-domain in the <session-tracking> element in the
orion-web.xml file for the application. The cookie-domain attribute contains
the DNS domain with at least two components of the domain name provided:
<session-tracking cookie-domain=".oracle.com" />
This is a comma-delimited list of cipher suites. If you omit this attribute, the set of
cipher suites used is according to those specified as "enabled by default" in the
reference documentation at:
http://java.sun.com/j2se/1.4.2/docs/guide/security/jsse/JSSERefGuid
e.html
Only the portions in bold are specific to security. The protocol value is always "http"
for HTTP communication in standalone OC4J, whether or not you use secure
communication. A protocol value of http with secure="false" indicates HTTP
protocol; http with secure="true" indicates HTTPS protocol.
The needs-client-auth flag instructs OC4J to request the client certificate chain
upon connection. If OC4J recognizes the root certificate of the client, then the client is
accepted.
The keystore that is specified in the <ssl-config> element must contain the
certificates of any clients that are authorized to connect to OC4J through HTTP and
SSL.
Notes:
■ It is possible to enter a real port here, rather than port 0, if you
configure OPMN to not override the setting in this Web site XML
file.
■ In an OC4J environment without Oracle HTTP Server, setting
needs-client-auth="true" is required in order to use
client-cert authentication mode. See "Requesting Client
Authentication" on page 15-15 for related information.
2. Also under component ID "OC4J", specify HTTPS protocol for the Web site:
<ias-component id="OC4J">
...
<port id="secure-web-site" range="12501-12600" protocol="https"/>
...
</ias-component>
See Also:
■ Oracle Process Manager and Notification Server Administrator’s Guide
for details about OPMN and opmn.xml
See Also:
■ Oracle HTTP Server Administrator’s Guide for related information
about using SSL with Oracle HTTP Server, including how to
customize your configuration to enable client authentication
■ Oracle Application Server Administrator’s Guide for information
about configuring additional Oracle Application Server
components to take advantage of SSL
The protocol value is always "ajp13" for communication through Oracle HTTP
Server, whether or not you use secure communication. A protocol value of ajp13
with secure="false" indicates AJP protocol; ajp13 with secure="true"
indicates AJPS protocol.
4. Ensure that server.xml points to secure-web-site.xml.
5. Stop and restart OC4J to initialize secure-web-site.xml.
Notes:
■ It is possible to enter a real port here, rather than port 0, if you
configure OPMN to not override the setting in this Web site XML
file.
■ In an Oracle Application Server environment, where Oracle HTTP
Server is the Web listener, the OC4J needs-client-auth
attribute in the <ssl-config> element is not relevant to SSL
authentication from the browser—that would be by arrangement
between the client and Oracle HTTP Server. This attribute is
relevant, however, if you want OC4J to require SSL authentication
from Oracle HTTP Server. See "Requesting Client Authentication"
on page 15-15 for related information.
Where cert_file_name is the desired file name for the certificate that is
produced, and keystore_file_name is the name of the keystore you already
created. You can optionally omit storepass from the command line and be
prompted for a password instead. You will receive a message confirming the
certificate file name if the command is successful.
3. Use Oracle Wallet Manager to import the generated certificate into your wallet.
Under "Operations", use "Import Trusted Certificate".
4. In Oracle HTTP Server, verify proper SSL settings in the mod_oc4j.conf file for
secure communication. SSL must be enabled, and you must specify a path to the
wallet you created in step 1. (It is not necessary to specify a wallet password here.)
Oc4jEnableSSL on
Oc4jSSLWalletFile wallet_path
The wallet_path value is a directory path to the wallet file, without a file name.
(The wallet file name is already known.)
See Also:
■ Oracle HTTP Server Administrator’s Guide for information about
mod_oc4j.conf
■ Regarding steps 1 and 3, Oracle Application Server Administrator’s
Guide for details about managing wallets and certificates
2. Also under component ID "OC4J", specify AJPS protocol for the Web site:
<ias-component id="OC4J">
...
<port id="secure-web-site" range="12501-12600" protocol="ajps"/>
...
</ias-component>
See Also:
■ Oracle Process Manager and Notification Server Administrator’s Guide
for details about OPMN and opmn.xml
Oc4jEnableSSL on
Oc4jSSLWalletFile C:\demotest\j2eetest\tsrc\shiphome\sslfiles\ssl.wlt\default
Oc4jSSLWalletPassword welcome1
<Location /oc4j-service>
SetHandler oc4j-service-handler
Order deny,allow
Deny from all
Allow from localhost ani-pc.us.oracle.com ani-pc
</Location>
</IfModule>
</category>
<category id="security-parameters">
<data id="wallet-file" value=
"file:C:/demotest/j2eetest/tsrc/shiphome/sslfiles/ssl.wlt/default"/>
<data id="wallet-password" value="welcome"/>
</category>
<category id="stop-parameters">
<data id="java-options" value=
"-Djava.security.policy=$ORACLE_HOME/j2ee/home/config/java2.policy
-Djava.awt.headless=true"/>
</category>
</module-data>
<start timeout="600" retry="2"/>
<stop timeout="120"/>
<restart timeout="720" retry="2"/>
<port id="secure-web-site" range="12501-12600" protocol="ajps"/>
<port id="rmi" range="3201-3300"/>
<port id="jms" range="3701-3800"/>
<process-set id="default_island" numprocs="1"/>
</process-type>
</ias-component>
<ias-component id="HTTP_Server">
<process-type id="HTTP_Server" module-id="OHS">
<module-data>
<category id="start-parameters">
<data id="start-mode" value="ssl-enabled"/>
</category>
</module-data>
<process-set id="HTTP_Server" numprocs="1"/>
</process-type>
</ias-component>
■ OC4J is authenticated to the client. A "secret key" is securely exchanged and used
for the encryption of the link.
■ The client is authenticated to OC4J.
Request client authentication through the needs-client-auth attribute of the
<ssl-config> element in secure-web-site.xml, as shown in the following
example, and then perform the steps that follow:
<web-site ... secure="true" ... >
...
<ssl-config keystore="path_and_file" keystore-password="pwd"
needs-client-auth="true" />
</web-site>
1. A certificate that OC4J trusts is called a trust point. Decide which of the certificates
in the chain from the client is to be your trust point. Ensure that you either have
control over the issuance of certificates using this trust point or that you trust the
certificate authority as an issuer.
2. Import the intermediate or root certificate in the server keystore as a trust point for
authentication of the client certificate.
Note: If you do not want OC4J to accept certain trust points, make
sure these trust points are not in the keystore.
3. Execute the steps to create the client certificate, documented in "Using SSL with
Standalone OC4J" on page 15-5. The client certificate includes the intermediate or
root certificate that is installed in the server. If you wish to trust another certificate
authority, obtain a certificate from that authority.
4. Save the certificate in a file on the client.
5. Provide the certificate for the client initiation of the secure connection.
OC4J accepts or rejects a client entity for secure communication according to the client
identity. If the root certificate of the client is recognized, then the client is accepted. The
keystore specified in the <ssl-config> element in secure-web-site.xml must
contain the certificates of any clients that are authorized to connect to OC4J.
In the certificate chain from the client, the trust point is the first certificate OC4J
encounters that matches one in its own keystore. There are three ways to establish
trust:
■ The client certificate is in the keystore.
■ One of the intermediate CA certificates in the certificate chain from the client is in
the keystore.
■ The root CA certificate in the certificate chain from the client is in the keystore.
OC4J verifies that the entire certificate chain up to and including the trust point is
valid to prevent any forged certificates.
authentication from the client (end user). In fact, this setting is required in order to use
client-cert authentication with the OC4J listener.
To provide a certificate, you would set the certificate in the client browser security area
if the client is a browser, or programmatically present the client certificate and the
certificate chain when initiating the HTTPS connection from a Java client.
Refer to the preceding section, "Overview of OC4J Client Authentication Mode", for
additional information.
See Also:
■ Chapter 16, "Oracle HTTPS for Client Connections"
Action: Use the keytool utility from the latest JDK on your system. To ensure
that you are using the latest JDK, specify the full path for this JDK.
Get the certificate from the Certificate Signing Request (CSR), then execute the
following command:
% keytool -keystore mykeystore -import -file my.host.com.cer -alias serverkey
No available certificate corresponds to the SSL cipher suites that are enabled
Cause: Something is wrong with your certificate.
Action: Determine and rectify the problem.
See Also:
■ Oracle Containers for J2EE Services Guide for general information
about using ORMI in OC4J
Because both the server.xml file and the rmi.xml file are typically in the
ORACLE_HOME/j2ee/home/config directory, the typical value for rmi_path is
"./rmi.xml".
See Also:
■ Oracle Containers for J2EE Configuration and Administration Guide
for details about server.xml
Note: The default RMI port is 23791; the default ORMIS port is
23943.
See Also:
■ Oracle Containers for J2EE Services Guide for additional information
about rmi.xml
Using a Keystore and Password The following example sets the SSL port to 23943 and
configures OC4J to use Oracle wallet-based certificates (as well as specifying an RMI
log file):
<rmi-server xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"http://xmlns.oracle.com/oracleas/schema/rmi-server-10_0.xsd"
port="23791" ssl-port="23943">
<ssl-config keystore="/wallets/wallet-server-a/ewallet.p12"
keystore-password="serverkey-a" />
...
<log>
<file path="../log/rmi.log" />
</log>
</rmi-server>
The value of the keystore attribute specifies the keystore location (absolute path, or
path relative to ORACLE_HOME/j2ee/home/config, where the Web site XML file is
located) and file name.
To use a Java keystore instead of an Oracle wallet, configure the <ssl-config>
element as in the following example:
<ssl-config keystore="/keystores/keystore_a.jks" keystore-password="serverkey-a"/>
When using keystores and passwords, the server keystore must contain the signed
certificate of any client that is authorized to connect to OC4J through ORMIS, or
contain the root CA-issued certificate of the client.
Using an Anonymous Cipher Suite Alternatively, you can enable ORMIS using
anonymous cipher suites. To accomplish this, omit the keystore and
keystore-password attributes from the <ssl-config> element:
<ssl-config />
In this mode, any ORMIS client can connect to the server without certification checks
being performed.
With this configuration, the non-secure ORMI listener will be disabled when OC4J is
restarted.
See Also:
■ Oracle Application Server Administrator’s Guide for general
information about OPMN and the opmn.xml file
<ssl-config keystore="../wallets/wallet-server-a/ewallet.p12"
keystore-password="serverkey-a" />
<access-mask default="deny">
<host-access domain="localhost" mode="allow"/>
<ip-access ip="192.168.1.0" netmask="255.255.255.0" mode="allow"/>
</access-mask>
...
</rmi-server>
See Also:
■ Oracle Containers for J2EE Servlet Developer’s Guide for additional
information about the <access-mask> element, which is
supported with the same functionality in orion-web.xml
Notes:
■ Either oc4j.keyStoreLoc or oc4j.rmi.keyStoreLoc is
acceptable. Similarly for keyStorePass.
■ To use ejb_sec.properties, place it in the current directory,
from which the client Java VM was launched.
This chapter discusses features of Oracle HTTPS for clients. These features provide
Secure Sockets Layer (SSL) functionality to client HTTP connections in conjunction
with functionality of the HTTPClient package, and support the use of the standard
Java Secure Socket Extension (JSSE). This chapter may be of interest for any Java
application that is to use SSL, where either OC4J is the Web listener (such as in
standalone OC4J), or OC4J is behind Oracle HTTP Server. The following topics are
included:
■ HTTPS and Clients
■ Overview of Client-Side HTTPS Features
■ Supported Default System Properties
■ Using HTTPClient with JSSE
■ HTTPClient Support for SSL Host Name Verification
■ Migrating from Oracle Java SSL to JSSE
■ Features for Oracle Java SSL (Deprecated)
Notes:
■ In addition to JSSE, Oracle Java SSL is also supported, but is
deprecated in the OC4J 10.1.3.1 implementation and will be
desupported in future releases. We recommend that you use
JSSE. As a step in the Oracle Java SSL deprecation, JSSE is the
default SSL implementation for HTTPClient in the OC4J
10.1.3.1 implementation. Aside from the last section on Oracle
Java SSL, this chapter emphasizes the use of JSSE.
■ This chapter assumes that you have already obtained keys and
certificates. For general information about configuring OC4J to
use the Secure Sockets Layer, see Chapter 15, "SSL
Communication with OC4J". You can also refer to that chapter
for information about "Requesting Client Authentication" on
page 15-15.
See Also:
■ For general information about JSSE:
http://java.sun.com/j2se/1.4.2/docs/guide/security/jss
e/JSSERefGuide.html
See Also:
■ Documentation for JSSE and the java.net package:
http://java.sun.com/products/jsse/index.jsp
http://java.sun.com/j2se/1.4.2/docs/api/
See Also:
■ Oracle Application Server Administrator’s Guide (in the chapter for
managing wallets and certificates) for details about creating and
using PKCS12 and SSO/auto-login wallets
See Also:
■ Javadoc for the java.net.URL class, at:
http://java.sun.com/j2se/1.4.2/docs/api/
SSL_RSA_WITH_RC4_128_MD5 *
SSL_RSA_WITH_RC4_128_SHA *
TLS_RSA_WITH_AES_128_CBC_SHA *
TLS_DHE_RSA_WITH_AES_128_CBC_SHA *
TLS_DHE_DSS_WITH_AES_128_CBC_SHA *
SSL_RSA_WITH_3DES_EDE_CBC_SHA *
SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA *
SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA *
SSL_RSA_WITH_DES_CBC_SHA *
SSL_DHE_RSA_WITH_DES_CBC_SHA *
SSL_DHE_DSS_WITH_DES_CBC_SHA *
SSL_RSA_EXPORT_WITH_RC4_40_MD5 *
SSL_RSA_EXPORT_WITH_DES40_CBC_SHA *
SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA *
SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA *
TLS_RSA_WITH_AES_256_CBC_SHA **
TLS_DHE_RSA_WITH_AES_256_CBC_SHA **
TLS_DHE_DSS_WITH_AES_256_CBC_SHA **
SSL_RSA_WITH_NULL_MD5
SSL_RSA_WITH_NULL_SHA
SSL_DH_anon_WITH_RC4_128_MD5
TLS_DH_anon_WITH_AES_128_CBC_SHA
TLS_DH_anon_WITH_AES_256_CBC_SHA **
SSL_DH_anon_WITH_3DES_EDE_CBC_SHA
SSL_DH_anon_WITH_DES_CBC_SHA
SSL_DH_anon_EXPORT_WITH_RC4_40_MD5
SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA
See Also:
■ For general information about JSSE:
http://java.sun.com/j2se/1.4.2/docs/guide/security/jss
e/JSSERefGuide.html
Note: You can set Java system properties on the JVM command line
for standalone OC4J, or in a Java property setting for the OC4J
instance in the opmn.xml file in an Oracle Application Server
environment. Setting system properties is described in the Oracle
Containers for J2EE Configuration and Administration Guide, in the
chapter on OC4J runtime configuration.
Property javax.net.ssl.keyStore
This property specifies the location and name of the keystore file or wallet file to use as
the keystore.
Property javax.net.ssl.keyStorePassword
This property can be set to indicate the password that is necessary to open the keystore
(keystore file or wallet file). For example:
javax.net.ssl.keyStorePassword=welcome1
Property javax.net.ssl.keyStoreType
This property specifies the type of file used for the keystore. With the Oracle JSSE
implementation (OraclePKIProvider), you can specify PKCS12 or SSO. With the
default Sun Microsystems JSSE implementation, you can specify JKS.
See Also:
■ The SSL overview in the Oracle Application Server Administrator’s
Guide for discussion of the PKCS12 type
Property javax.net.ssl.trustStore
This property is used similarly to javax.net.ssl.keyStore, but specifies the
location and name of the keystore file or wallet file to use as the truststore (a file that
includes the trusted certificate authorities that a client will implicitly accept).
Property javax.net.ssl.trustStorePassword
This property is used similarly to javax.net.ssl.keyStorePassword, but
specifies the password that is necessary to open the truststore (keystore file or wallet
file).
Property javax.net.ssl.trustStoreType
Similarly to javax.net.ssl.keyStoreType, this property specifies the type of file
used for the truststore—PKCS12 or SSO for the Oracle JSSE implementation, or JKS
for the default Sun Microsystems JSSE implementation.
See Also:
■ Oracle Application Server Administrator’s Guide (in the chapter for
managing wallets and certificates) for information about Oracle
Wallet Manager and orapki features for creating and
maintaining wallets
■ For complete information on JSSE:
http://java.sun.com/products/jsse/
See Also:
■ For details on using the keytool:
http://java.sun.com/j2se/1.3/docs/tooldocs/win32/keyto
ol.html
2. Set the truststore property. A client wishing to use JSSE must specify the client
truststore location through the javax.net.ssl.trustStore property. The
client is not required to set the javax.net.ssl.keyStore property.
3. Obtain the JSSE SSL socket factory (javax.net.ssl.SSLSocketFactory
instance) by calling the static SSLSocketFactory.getDefault() method.
4. Create an HTTPClient connection (HTTPConnection instance).
5. Configure the HTTPClient connection to use the JSSE implementation of SSL.
HTTPClient can be configured to use JSSE in either of the following ways:
■ (For each connection) The client calls the following method on the
HTTPConnection instance, specifying the JSSE SSL socket factory retrieved
by the getDefault() method in step 3:
void setSSLSocketFactory(SSLSocketFactory factory)
In this case, the SSL socket factory is set for only this connection instance.
Example 16–1 below demonstrates this technique.
■ (Entire VM) The client calls the following static method on the
HTTPConnection class:
void HttpConnection.setDefaultSSLSocketFactory(SSLSocketFactory factory)
In this case, the SSL socket factory is set for all connection instances in the Java
VM, until the method is called again with a different setting. This method
must be called before instantiating any HTTPConnection instances that are to
be affected.
6. There must be a call to the HTTPConnection class connect() method before
sending any HTTPS data. This allows the connection to verify the SSL
handshaking that must occur between client and server before any data can be
encrypted and sent. In the Oracle implementation, this method is called implicitly
during calls to HTTP methods, such as the HTTPConnection class Get()
method. In addition, an explicit call to the connect() method is useful when the
calling application requires SSL session information before sending data. Also see
"Verifying Additional Connection Information" on page 16-10.
7. Use the HTTPConnection instance normally. At this point, the client is set up to
use HTTPClient with JSSE. There is no additional configuration necessary and
basic usage is the same.
Notes:
■ If no SSL socket factory is specified, JSSE would be used
anyway, by default, if Oracle Java SSL is not specified as
preferred or if Oracle Java SSL classes are not found in the
application classpath. If no SSL socket factory is specified and
Oracle Java SSL is specified as preferred, and Oracle Java SSL
classes are found in the classpath, then Oracle Java SSL is used
by default. Also see "Specifying Oracle Java SSL as the SSL
Implementation for HTTPClient" on page 16-13.
■ The JSSE SSL implementation is not thread-safe.
See Also:
■ Javadoc for javax.net.ssl.HostnameVerifier, available
through:
http://java.sun.com/j2se/1.4.2/docs/api/
The section discusses how to enable and use this feature, covering the following
topics:
■ Enabling Host Name Verification through System Property Setting
■ Enabling Host Name Verification Programmatically
■ Using the Oracle Standard Host Name Verifier
■ Verifying Additional Connection Information
Without either the system property setting or the programmatic setting described
below, host name verification will not be performed.
After the connection is established, the connection information, in this example the
server certificate chain, is obtained as follows:
peerCerts = (httpsConnection.getSSLSession()).getPeerCertificateChain();
(The user’s certificate is first in the array; the root CA’s certificate is last.)
If the certificate name is not the same as the host name used to connect to the server,
then the connection is aborted as follows:
if(peerCertDN.lastIndexOf("cn="+ hostname) == -1)
{
System.out.println("Certificate for " + hostname + " is issued to " +
peerCertDN);
System.out.println("Aborting connection");
System.exit(-1);
}
See Also:
■ Javadoc for Keystore and the javax.net.ssl classes, available
through:
http://java.sun.com/j2se/1.4.2/docs/api/
cred.loadWallet("walletpath", "password");
Create and set trust managers so the SSL connection can verify the peer certificate
chain. Create and set key managers so the SSL connection can access the user
certificate and private key. Then use key managers and trust managers to
configure the SSL context, which is used to create new SSL socket factories. Once
an SSLSocketFactory instance is created, you can use it to create SSL sockets.
This method creates a new socket layered over an existing socket. Specify the
existing socket, server host, server port, and whether to close the underlying
socket when the created socket is closed.
■ There is a difference in the peer certificate chain returned by the SSL session object.
For Oracle Java SSL: The getPeerCertificateChain() method of
OracleSSLSession returns a certificate chain with the root CA certificate first
and the peer certificate last.
For JSSE: The getPeerCertificates() method (preferred) or
getPeerCertificateChain() method (maintained for backward
compatibility) of SSLSession returns a certificate chain with the peer certificate
first and the root CA certificate last.
Note: Depending on the JDK you use, Oracle Java SSL requires the
file jssl-1_1.jar or jssl-1_2.jar to be in the classpath.
See Also:
■ Oracle Advanced Security Administrator’s Guide for information
about Oracle Java SSL
try
{
httpsConnection = new HTTPConnection("https", hostname, port);
}
catch(IOException e)
{
System.out.println("HTTPS Protocol not supported");
System.exit(-1);
}
try
{
credential = new OracleSSLCredential();
credential.setWallet(walletPath, password);
}
catch(IOException e)
{
System.out.println("Could not open wallet");
System.exit(-1);
}
httpsConnection.setSSLCredential(credential);
try
{
httpsConnection.connect();
}
catch (IOException e)
{
System.out.println("Could not establish connection");
e.printStackTrace();
System.exit(-1);
}
{
System.err.println("Unable to obtain peer credentials");
System.exit(-1);
}
String peerCertDN =
peerCerts[peerCerts.length -1].getSubjectDN().getName();
peerCertDN = peerCertDN.toLowerCase();
if(peerCertDN.lastIndexOf("cn="+ hostname) == -1)
{
System.out.println("Certificate for " + hostname + " is issued to "
+ peerCertDN);
System.out.println("Aborting connection");
System.exit(-1);
}
try
{
HTTPResponse rsp = httpsConnection.Get("/");
System.out.println("Server Response: ");
System.out.println(rsp);
}
catch(Exception e)
{
System.out.println("Exception occured during Get");
e.printStackTrace();
System.exit(-1);
}
}
}
2. After the credentials are created, pass them to your HTTPConnection instance
(here called httpsConnection) through its setSSLCredential() method.
This method takes the OracleSSLCredential instance, created in the first step,
as input:
httpsConnection.setSSLCredential(mycredential);
The private key, user certificate, and trust points located in the wallet can now be used
for the connection.
■ If no other credentials have been set for the HTTPS connection, then the file
indicated by this property is opened when a handshake first occurs. If any errors
occur as this file is read, then the connection fails and an IOException is thrown.
■ If this property has no setting, the application is responsible for verifying that the
certificate chain contains a certificate that can be trusted.
Property Oracle.ssl.defaultCipherSuites
For Oracle Java SSL, Oracle.ssl.defaultCipherSuites property can be set to a
comma-delimited list of cipher suites. For example:
Oracle.ssl.defaultCipherSuites=
SSL_RSA_WITH_DES_CBC_SHA,
SSL_RSA_EXPORT_WITH_RC4_40_MD5,
SSL_RSA_WITH_RC4_128_MD5
You can set this property before establishing an SSL connection using Oracle Java SSL.
The cipher suites that you specify in this property setting are used as the enabled
cipher suites for new HTTPS connections.
See Also:
■ Table 16–1, " Cipher Suites Supported by Oracle Java SSL"
below
Method setSSLEnabledCipherSuites()
For Oracle Java SSL, you can also set cipher suites per connection by using the
following method of the HTTPConnection class in package HTTPClient:
■ boolean setSSLEnabledCipherSuites(String[] cipherSuites)
This takes a Java string array, with each array element specifying a cipher suite. It
returns a boolean indicating whether the current SSL implementation supports this
method.
See Also:
■ Oracle Application Server HTTPClient Java API Reference (Javadoc)
for additional information
This chapter discusses security issues affecting Web applications, covering the
following topics:
■ Specifying the Authentication Method (auth-method)
■ Web Application Security Role and Constraint Configuration
See Also:
■ Oracle Containers for J2EE Servlet Developer’s Guide for general
information about Web applications
■ "Synchronization of OracleAS JAAS Provider User Context
with Servlet Sessions" on page 8-11 for information relevant
when using Oracle Identity Management as the security
provider with Oracle Single Sign-On
■ "Introduction to JAAS Mode" on page 5-5 and "Configuring
and Using JAAS Mode" on page 5-18 for information about
JAAS mode, which can be used with Web applications
■ The following Web site for OC4J "how-to" examples:
http://www.oracle.com/technology/tech/java/oc4j/1013
/how_to/index.html
...
<login-config>
<auth-method>BASIC</auth-method>
...
</login-config>
...
</web-app>
Notes:
■ For either the file-based provider or Oracle Identity
Management, we recommend digest authentication as a more
secure solution than basic authentication.
■ When you use DIGEST with Oracle Identity Management as
your security provider, you must take preparatory steps as
described in "Using Digest Authentication with Oracle Internet
Directory" on page 8-15.
■ When you use FORM, you can optionally set an OC4J flag for
appropriate client-side redirects, as described in "Using
Form-Based Authentication" on page 17-4. (This section also
discusses standard configuration for form-based
authentication.)
■ To use CLIENT-CERT, you must also configure the OracleAS
JAAS Provider property x509cert.mapping.attribute, as
described in "Using Client-Cert Authentication" on page 17-5.
See Also:
■ "Web Application Standard Authentication Methods" on
page 2-2 for a summary of these authentication methods
■ The next section, "Specifying auth-method in
orion-application.xml", for Oracle-specific authentication
methods
"SSO" (for Oracle Single Sign-On), "COREIDSSO" (for Oracle Access Manager single
sign-on), and "CUSTOM_AUTH" (to use the identity management framework, including
Java SSO). Refer to "Overview of Oracle Application Server Single Sign-On
Alternatives" on page 3-6 for more information about these features. The following
example is for Oracle Single Sign-On:
<orion-application ... >
...
<jazn provider="LDAP" >
<jazn-web-app auth-method="SSO"/>
...
</jazn>
...
</orion-application>
Notes:
■ The authentication method is set in
orion-application.xml automatically for SSO alternatives
you configure through Application Server Control (Oracle
Single Sign-On and Java SSO).
■ Any standard authentication method should be configured in
the web.xml file as described in the preceding section,
"Specifying auth-method in web.xml", not in any OC4J-specific
file. (This differs in some cases from proprietary functionality in
earlier releases, although that functionality is still supported for
backward compatibility.)
■ The <jazn-web-app> element is also supported in the
orion-web.xml file. In the event of conflict, orion-web.xml
takes precedence over orion-application.xml for the
particular Web application in question.
■ A setting for auth-method in orion-application.xml (or
orion-web.xml) overrides any setting in web.xml.
See Also:
■ "Overview of Oracle Application Server Single Sign-On
Alternatives" on page 3-6 for a summary of Oracle-specific
authentication methods
To avoid using basic authentication fallback, either do not set this property, or
explicitly set it to "false".
Important:
■ In standalone OC4J (no Oracle HTTP Server), setting
needs-client-auth="true" in the <ssl-config> element
in secure-web-site.xml is required in order to use client-cert
authentication mode. This attribute is discussed in "Optional Steps
in secure-web-site.xml" on page 15-7.
■ If you switch from the file-based provider to Oracle Identity
Management at any time for any application through Application
Server Control, the <jazn> element in
orion-application.xml for the application is replaced with
the following. Any prior settings within the <jazn> element
would be lost and would have to be redone.
<jazn provider="LDAP" />
You also define the access permissions for the sr_developers role in web.xml. A
role is tied to capabilities and constraints through additional standard descriptor
elements, such as under the <security-constraint> element (also a subelement of
<web-app>):
<web-app>
...
<security-constraint>
<web-resource-collection>
<web-resource-name>access to the entire application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<!-- authorization -->
<auth-constraint>
<role-name>sr_developers</role-name>
</auth-constraint>
</security-constraint>
...
</web-app>
...
</web-app>
<run-as>
<role-name>sr_developers</role-name>
</run-as>
...
</servlet>
The role name must be one of the roles already defined for the Web application. The
Web container must propagate the specified identity for any call from a servlet to the
EJB layer.
See Also:
■ "Run-As Mode and Propagated Identities in Web Applications"
on page 2-3
This association permits the developers role to access resources that are configured
in web.xml to be accessible for the sr_developers role.
Consider a user john, for example, who is a member of the developers role.
Because this role is mapped to the J2EE role sr_developers, john has access to
application resources that are made available to the sr_developers role.
This chapter discusses security issues affecting EJBs, covering the following topics:
■ Authenticating and Authorizing EJB Applications
■ Specifying Credentials in EJB Clients
■ Permitting EJB RMI Client Access
■ Granting Permissions in the Browser
■ Configuring Anonymous EJB Lookup
■ Enabling and Configuring Subject Propagation for ORMI
Note that beginning with OC4J 10.1.3.x implementations, the EJB container supports
the OracleAS JAAS Provider.
See Also:
■ Oracle Containers for J2EE Enterprise JavaBeans Developer’s Guide
for general information about EJBs and information about EJB
3.0 security annotations
■ Oracle Containers for J2EE Services Guide for information about
ORMI
■ "Enabling ORMIS for OC4J" on page 15-18 (in this document)
for information about ORMIS
■ "JAAS Authorization and OracleAS JAAS Provider JAAS
Mode" on page 5-4 and "Configuring and Using JAAS Mode"
on page 5-18 for information about JAAS mode, which can be
used with EJB applications
■ Chapter 19, "Common Secure Interoperability Protocol" for
information about CSIv2, used in conjunction with EJBs
■ The following Web site for OC4J "how-to" examples:
http://www.oracle.com/technology/tech/java/oc4j/1013
/how_to/index.html
Figure 18–1 provides an overview of EJB role definitions and role mapping (in this
case for the file-based provider).
The steps for EJB authorization are described in the following sections:
■ Specifying J2EE Roles and Method Permissions in the EJB Deployment Descriptor
■ Specifying Unchecked Security for EJB Methods
■ Specifying a Run-As or Caller Security Identity for an EJB
■ Mapping J2EE Roles to Deployment Users and Roles
■ Configuring Namespace Access
■ Specifying a Default Role Mapping for Unidentified Methods
Troubleshooting Tips:
■ For an application to access EJBs using RMI, you must grant
RMI permission "login" to the appropriate user or role. Refer to
"Permitting EJB RMI Client Access" on page 18-10.
■ If an application contains an EJB, remote clients must be
granted access for read (lookup) and write (bind) operations on
the server-side JNDI context of the application, as required.
Refer to "Configuring Namespace Access" on page 18-8.
Specifying J2EE Roles and Method Permissions in the EJB Deployment Descriptor
As shown in Figure 18–2 below, you can specify the name of a role (such as POMgr)
that is defined within your bean implementation, and link this name to the
appropriate J2EE user or role (such as myMgr) that is defined in the standard EJB
deployment descriptor. (The next step, mapping to a deployment role, is reflected in
the OC4J-specific deployment descriptor, as discussed in "Mapping J2EE Roles to
Deployment Users and Roles" on page 18-6.)
the standard EJB deployment descriptor. (For this example, assume this role has
purchase order authority. A caller would have to be mapped into this role, as
confirmed by an isCallerInRole() call, to work with a purchase order.)
Use a <role-link> subelement of <security-role-ref> to link the
application role to a desired J2EE logical role (which you will define in the next
step, also in the standard EJB deployment descriptor). This functionality allows
you to use your application in various J2EE environments without changing the
bean code. The application role POMgr is linked to the J2EE role myMgr:
<enterprise-beans>
...
<security-role-ref>
<role-name>POMgr</role-name>
<role-link>myMgr</role-link>
</security-role-ref>
...
</enterprise-beans>
(The J2EE role in the <role-link> setting can be the same as a deployment role,
or it can be mapped to a deployment role in a later step.)
2. Define the J2EE role and the EJB methods for which it has permissions in the
standard EJB deployment descriptor. In this purchase order example, assume any
method executed within a bean PurchaseOrder must have authorized itself as
myMgr, a J2EE role that is declared through a <role-name> subelement of
<security-role>. This is the J2EE role that was linked to the application role
POMgr in the previous step. Note that PurchaseOrder is the name declared in
the <ejb-name> element, a subelement of the <session> or <entity> element.
The following example defines the role myMgr and gives it permission to access all
methods (as indicated by the "*" symbol) of the EJB PurchaseOrder bean:
<assembly-descriptor>
...
<security-role>
<description>Role for purchase order authorization</description>
<role-name>myMgr</role-name>
</security-role>
<method-permission>
<role-name>myMgr</role-name>
<method>
<ejb-name>PurchaseOrder</ejb-name>
<method-name>*</method-name>
</method>
</method-permission>
...
</assembly-descriptor>
After performing both steps, you can refer to POMgr within the bean implementation,
and OC4J maps POMgr to myMgr.
■ Defining a specific method that is uniquely identified within the bean. Use the
appropriate interface name and method name, as follows:
<method-permission>
<role-name>myMgr</role-name>
<method>
<ejb-name>myBean</ejb-name>
<method-name>myMethodInMyBean</method-name>
</method>
</method-permission>
The parameters are the fully-qualified Java types of the input parameters of the
method. If the method has no input arguments, the <method-params> element
contains no subelements.
Alternatively, the following example demonstrates how to specify that all methods of
the bean execute under the identity of the caller:
<enterprise-beans>
<entity>
...
<security-identity>
<use-caller-identity/>
</security-identity>
...
</entity>
</enterprise-beans>
provider. This security role mapping can be accomplished through Application Server
Control during deployment, as described in "Specifying Security Role Mapping
through Application Server Control" on page 6-11.
Mappings are reflected in <security-role-mapping> settings in Oracle-specific
descriptors, as shown in the discussion that follows.
See Also:
■ Oracle Containers for J2EE Developer’s Guide for information
about the orion-application.xml file
■ Oracle Containers for J2EE Enterprise JavaBeans Developer’s Guide
for information about the orion-ejb-jar.xml file
While we recommend that you use Application Server Control for role mapping, the
following discussion provides reference information for the resulting configuration in
orion-ejb-jar.xml when you map the J2EE role myMgr to the deployment role
managers. Any user that can log in as part of the managers role is considered to
have permissions of the myMgr role (which had previously been linked to the POMgr
application logical role), and can execute the methods of the PurchaseOrder bean.
In the standard EJB deployment descriptor:
<assembly-descriptor>
...
<security-role>
<role-name>myMgr</role-name>
</security-role>
<method-permission>
<role-name>myMgr</role-name>
<method>...</method>
</method-permission>
...
</assembly-descriptor
This assumes the indicated role mappings had already been set up elsewhere in
orion-application.xml.
For example, if you want to access remote EJBs as POMGR/welcome, set the properties
as follows. The java.naming.factory.initial setting indicates that you will use
the Oracle JNDI implementation:
java.naming.security.principal=POMGR
java.naming.security.credentials=welcome
java.naming.factory.initial=
oracle.j2ee.naming.ApplicationClientInitialContextFactory
java.naming.provider.url=ormi://myhost/ejbsamples
In your application program, authenticate and access the remote EJBs as shown in the
following example:
InitialContext ic = new InitialContext();
CustomerHome =
(CustomerHome)ic.lookup("java:comp/env/purchaseOrderBean");
For the file-based provider, you can also grant this permission to a role through
Application Server Control, by selecting the role and checking the "Grant RMI
Permission" checkbox. (Also refer to "Create a Role" on page 7-7 or "Edit a Role" on
page 7-8.)
Restart OC4J for changes to take effect.
See Also:
■ Appendix C, "OracleAS JAAS Provider Admintool Reference"
■ "Policy Configuration in system-jazn-data.xml" on page 5-15
<role>
<name>users</name>
<members>
<member>
<type>user</type>
<name>anonymous</name>
</member>
</members>
</role>
...
</roles>
...
</realm>
...
</jazn-realm>
...
</jazn-data>
3. Give the role (users in this example) appropriate namespace access so that it can
execute read (lookup) and write (bind) operations on the server-side JNDI context
of the application. Use configuration such as the following in the
orion-application.xml file for the application:
<orion-application>
...
<namespace-access>
<read-access>
<namespace-resource root="">
<security-role-mapping name="jndi-user-role">
<group name="administrators" />
<group name="users" />
</security-role-mapping>
</namespace-resource>
</read-access>
<write-access>
<namespace-resource root="">
<security-role-mapping name="jndi-user-role">
<group name="administrators" />
<group name="users" />
</security-role-mapping>
</namespace-resource>
</write-access>
</namespace-access>
...
</orion-application>
With this configuration, you can access remote EJBs without specifying principals or
credentials.
Important:
■ Subject propagation is a powerful feature that should be used
only in environments where the server is secure from untrusted
client access. It is therefore advised, in order to ensure proper
integrity of client requests, that appropriate safeguards be
established before this feature is used in production
environments. For example, consider using application or
network firewalls, RMI access restrictions (through the
<access-mask> element in rmi.xml, as documented in
"Configuring ORMIS Access Restrictions" on page 15-21), or
RMI subject-propagation restrictions (through the
<subject-propagation-mask> element in rmi.xml, as
documented in "Removing and Configuring Subject
Propagation Restrictions" on page 18-15).
■ Subject propagation is supported only between OC4J 10.1.3.x
instances.
Enterprise Information
System Tier
Password
Caller ID Database
EJB EJB
ERP, SAP
Applications
In the current release, this setting controls subject propagation at a global OC4J level.
You can also grant subject.propagation permission to a role. With the following
example, any user in the users role would have its subject propagated to the server:
% java -jar jazn.jar -grantperm myrealm -role users \
com.evermind.server.rmi.RMIPermission subject.propagation
You can restrict subject propagation by specifying the principal names that the server
will accept in the subject. The following example again grants
subject.propagation permission to any user in the users role, but the server will
filter out all but the developer and manager principals from propagated subjects.
(Note that the filtering is according to principal names, not principal types.)
% java -jar jazn.jar -grantperm myrealm -role users \
com.evermind.server.rmi.RMIPermission subject.propagation developer,manager
By default, there is no restriction—all principals in the subject are accepted. But you
can also explicitly specify this with the subject.propagation parameter "*"
(including the quotes):
% java -jar jazn.jar -grantperm myrealm -user oc4jadmin \
com.evermind.server.rmi.RMIPermission subject.propagation "*"
To use the CSIv2 protocol with OC4J, you must both set ssl to true and specify an
IIOP/SSL port (ssl-port). Note the following:
■ If you do not set ssl to true, CSIv2 is not enabled.
■ Setting ssl to true permits clients and servers to use CSIv2, but does not require
them to communicate using SSL.
■ If you do not specify ssl-port, then no CSIv2 component tag is created, even if
you configure an <ior-security-config> entity in orion-ejb-jar.xml.
When IIOP/SSL is enabled on the server, OC4J listens on two different sockets—one
for server authentication alone and one for server and client authentication. Specify
the server authentication port number within the <sep-property> element. OC4J
adds 1 to this for the server and client authentication port number.
For SSL clients using server authentication alone, you can specify your choice of the
following:
■ Truststore only
■ Both keystore and truststore
■ Neither
If you specify neither keystore nor truststore, the handshake may fail if there are no
default truststores established by the security provider.
SSL clients using client authentication must specify both a keystore and a truststore.
The certificate from the keystore is used for client authentication.
The following example shows a typical internal-settings.xml file:
<server-extension-provider name="IIOP"
class="com.oracle.iiop.server.IIOPServerExtensionProvider">
<sep-property name="port" value="5555" />
<sep-property name="host" value="localhost" />
<sep-property name="ssl" value="true" />
<sep-property name="ssl-port" value="5556" />
<sep-property name="ssl-client-server-auth-port" value="5557" />
<sep-property name="keystore" value="keystore.jks" />
Notes:
■ You cannot update internal-settings.xml through
Application Server Control.
■ Although here the default value of port is one less than the
default value for ssl-port, this relationship is not required.
■ If OC4J is started by the Oracle Process Manager and
Notification Server (OPMN) in an Oracle Application Server
environment, the ports specified in
internal-settings.xml are overridden. Note that IIOP
SSL ports may fail to start if the keystore location, truststore
location, or either password is missing or incorrect. In such a
case, you are advised to look at the appropriate OPMN log file
to see the exact nature of the failure.
■ If OPMN is configured to disable IIOP for a particular OC4J
instance, then any setting to enable IIOP through
internal-settings.xml is overridden. (Refer to the Oracle
Containers for J2EE Services Guide RMI chapter for information
about enabling or disabling IIOP through OPMN.)
■ Keystore and truststore settings are supported in
internal-settings.xml for both standalone OC4J and a
full Oracle Application Server environment. In Oracle
Application Server, there are no OPMN options to set these
values, so they must be configured manually.
If the client does not use client-side SSL authentication, you must set
client.sendpassword in the ejb_sec.properties file in order for the client
runtime to insert a subject and send the user name and password. You must also set
server.trustedhosts to include your server.
If the client does use client-side SSL authentication, the server extracts the DN from
the client's certificate and then looks it up in the corresponding security provider; it
does not perform password authentication.
Two types of trust relationships exist:
■ Clients trusting servers to transmit user names and passwords using non-SSL
connections
■ Servers trusting clients to send identity assertions, which delegate an originating
client’s identity
Clients list trusted servers in the EJB property oc4j.iiop.trustedServers.
Servers list trusted clients in the trusted-client property of the <sep-property>
element in internal-settings.xml, discussed in "CSIv2 Security Properties in
internal-settings.xml (EJB Server)" on page 19-1.
Conformance level 0 of the EJB standard defines two ways of handling trust
relationships:
■ Presumed trust, in which the server presumes that the logical client is trustworthy,
even if the logical client has not authenticated itself to the server, and even if the
connection is not secure.
■ Authenticated trust, in which the target trusts the intermediate server based on
authentication, either at the transport level or in the trusted-client list or
both.
Notes:
■ Server-side authentication takes precedence over a user name
and password.
■ You can also configure the server to both require SSL client
authentication and specify a list of trusted client (or
intermediate) hosts that are allowed to insert identity
assertions.
Notes:
■ If you set <establish-trust-in-client> to required,
this overrides setting <auth-method> to
username_password under <as-context>. If you do this,
you must also set the <required> element in the
<as-context> section to false; otherwise access permission
issues will arise.
■ Setting any of the <transport-config> properties to
required means that the bean will use RMI/IIOP/SSL to
communicate.
Example: <ior-security-config>
The following example uses the <ior-security-config> element and its
subelements:
<ior-security-config>
<transport-config>
<integrity>supported</integrity>
<confidentiality>supported</confidentiality>
<establish-trust-in-target>supported</establish-trust-in-target>
<establish-trust-in-client>supported</establish-trust-in-client>
</transport-config>
<as-context>
<auth-method>username_password</auth-method>
<realm>default</realm>
<required>true</required>
</as-context>
<sas-context>
<caller-propagation>supported</caller-propagation>
</sas-context>
</ior-security-config>
This chapter discusses security considerations and how to configure security and
authentication when using resource adapters for an enterprise information system
(EIS) connection. The following topics are covered:
■ Overview of Security and Authentication Setup for EIS Connections
■ Understanding Component-Managed Sign-On
■ Understanding Container-Managed Sign-On
■ Using Declarative Container-Managed Sign-On
■ Using Programmatic Container-Managed Sign-On
See Also:
■ Oracle Containers for J2EE Resource Adapter Administrator’s Guide for
general information about resource adapters and the J2EE
Connector Architecture
■ The commonly used basic password mechanism relies on a user name / password
pair, contained together in a password credential object. The application server
passes this object to the resource adapter for authentication.
■ The Kerberos version 5 mechanism ("Kerbv5" for short) is an authentication
protocol distributed by the Massachusetts Institute of Technology. This mechanism
uses a "generic credential" object that encapsulates credential information such as
a Kerberos ticket. The application server passes this object to the resource adapter
for verification.
Security contract functionality includes use of the following key interfaces:
■ javax.security.auth.Subject
■ java.security.Principal
■ javax.security.auth.spi.LoginModule
■ javax.resource.spi.security.PasswordCredential
This J2EE Connector Architecture class represents a user name / password pair for
basic password authentication.
■ org.ietf.jgss.GSSCredential (in J2SE version 1.4)
This interface represents a generic credential object for Kerberos version 5
authentication. (This replaces the J2EE Connector Architecture
javax.resource.spi.security.GenericCredential interface, which is
deprecated.)
Which
Declarative OC4J-Managed Programmatic
Sign-On
Mode?
Developer
Develop JAAS
Login Module
(As Applicable)
Administrator
Implement Interface How to Extend Abstract Configure JAAS
Directly Implement Class Login Module
Principal Mapping Instance
Class?
Developer Developer
Implement Extend
PrincipalMapping AbstractPrincipalMapping
Interface Class
Administrator Administrator
Configure Principal Configure Principal
Mapping Instance Mapping Instance
See Also:
■ Oracle Containers for J2EE Resource Adapter Administrator’s Guide for
additional information about the files and elements discussed
here
The <security-config> element specifies the user name and password for
container-managed sign-ons.
There are two ways of supplying this information in the <security-config>
element of the oc4j-ra.xml file:
■ Specify mapping subelements explicitly (in the
<principal-mapping-entries> subelement).
■ Specify the name of a user-created mapping class that either implements
oracle.j2ee.connector.PrincipalMapping or inherits from
oracle.j2ee.AbstractPrincipalMapping (in the
<principal-mapping-interface> subelement).
Authentication issues are discussed in detail in "Authentication in Container-Managed
Sign-On" on page 20-9. This section discusses only the syntax for the
<security-config> element.
A <security-config> element contains one of the following:
■ <principal-mapping-entries> element, specifying user names and
passwords explicitly
■ <principal-mapping-interface> element, specifying the name of the
mapping class
■ <jaas-module> element, specifying the JAAS module to be used for
authentication
This element specifies the permissions to be granted to each resource adapter. Each
<security-permission> element contains a <security-permission-spec>
setting that conforms to the Java 2 Security policy file syntax.
OC4J automatically generates a <security-permission> element in
oc4j-connectors.xml for each <security-permission> element in ra.xml.
Each generated element has the enabled attribute set to "false". Setting the
enabled attribute to "true" grants the named permission.
<oc4j-connectors>
<connector name="myEIS" path="eis.rar">
. . .
<security-permission>
<security-permission-spec enabled="false">
grant {permission java.lang.RuntimePermission "LoadLibrary", *’};
</security-permission-spec>
</security-permission>
</connector>
</oc4j-connectors>
OC4J
Client
2
Get connection
1 with explicit 3
Request with outgoing security Logon to EIS
incoming Application context determined Resource with outgoing
Component Adapter EIS
security context by component security context
4
Interact with EIS under
explicit outgoing security
context
1. The client makes a request, which is associated with an incoming subject (security
context) for the initiating principal.
2. As part of servicing the request, the application component maps the incoming
subject to an outgoing subject for the resource principal, or hard-codes an
outgoing subject, then uses the outgoing subject to request a connection to the EIS.
3. As part of the connection acquisition, the resource adapter signs on to the EIS
using the outgoing subject provided by the application component.
4. Once the connection is acquired, the application component can interact with the
EIS under the established outgoing subject.
The following example is an excerpt from an application that performs
component-managed sign-on:
Context initctx = new InitialContext();
// Perform JNDI lookup to obtain a connection factory.
javax.resource.cci.ConnectionFactory cxf =
(javax.resource.cci.ConnectionFactory)initctx.lookup
("java:com/env/eis/MyEIS");
// Assume a custom class ConnectionSpecImpl, used to store sign-on credentials.
OC4J
Custom
Authentication
Mechanism
3
Map incoming
security context
to outgoing
security context
Client
OC4J Security
2 Context Manager
Get connection For Resource
without explicit Adapters 4
1
Request with outgoing security Logon to EIS
incoming Application context Resource with outgoing
Component Adapter EIS
security context security context
5
Interact with EIS
under established
outgoing security
context
1. The client makes a request, which is associated with an incoming subject (security
context) for the initiating principal.
2. As part of servicing the request, the application component requests a connection
to the EIS.
3. As part of the connection acquisition, the container (the OC4J security context
manager shown in the figure) maps the incoming subject to the outgoing subject
for the resource principal. This is based on principal mapping entry elements, a
principal mapping class, or a JAAS login module.
4. The resource adapter logs in to the EIS using the outgoing subject provided by
OC4J.
5. Once the connection is acquired, the application component can interact with the
EIS under the established outgoing subject.
The following example is an excerpt from an application that depends on
container-managed sign-on:
Context initctx = new InitialContext();
1. From the Connection Factories tab of the appropriate Resource Adapter page,
choose the connection factory you want to edit. Connection factories are listed by
JNDI location.
2. In the Edit Connection Factory page, go to the Security tab.
3. Choose to enable security for container-managed sign-on.
4. Specify declarative principal mappings. This is to specify the default resource user.
a. Specify the default resource user name.
b. Specify a password for the default resource user. You can choose to do this
either indirectly or by typing the desired password in clear text. For an
indirect password, specify a key (which might just be the user name, for
example). OC4J uses the key to do a lookup in the security provider (such as
through the system-jazn-data.xml file).
See Also:
■ "Using Password Indirection" on page 6-1
5. Specify initiating user mappings. Specify a mapping for each initiating principal
that you want to map to a resource principal. You can edit an existing row or
change an existing mapping, or add another row to specify a new mapping. For
each mapping:
a. Specify the initiating user, which is the user name of an initiating principal.
b. Specify the resource user, which is the user name for a corresponding resource
principal.
c. Specify the resource password, which is a password for the mapped resource
principal. As with the default principal mapping, you can choose to do this
either indirectly or by typing the password directly.
6. Choose Apply to apply the changes.
Table 20–1 following summarizes how these settings correspond to XML entities in the
oc4j-ra.xml file. An example follows the table.
import java.util.*;
import javax.resource.spi.*;
import javax.resource.spi.security.*;
import oracle.j2ee.connector.AbstractPrincipalMapping;
import javax.security.auth.*;
import java.security.*;
<principal-mapping-interface>
<impl-class>com.example.app.MyMapping</impl-class>
<property name="user" value="scott" />
<property name="password" value="tiger" />
</principal-mapping-interface>
</security-config>
...
</connector-factory>
</oc4j-connector-factories>
See Also:
■ Chapter 9, "Login Modules"
incorporates them into the subject that is passed to the initialize() method of a
login module. The InitiatingPrincipal class implements the
java.security.Principal interface and adds the method getGroups().
The oracle.j2ee.connector.InitiatingGroup class also implements the
Principal interface, but represents OC4J roles. OC4J creates an
InitiatingPrincipal instance and incorporates it into the subject that is passed
either to the initialize() method of a login module, or to the mapping() method
of a principal mapping class. The InitiatingPrincipal class also has a
getGroups() method.
The getGroups() method returns a set (java.util.Set instance) of
InitiatingGroup objects, representing the OC4J roles or OracleAS JAAS Provider
roles for this OC4J user. The role membership is defined in an OC4J-specific descriptor
file, typically system-jazn-data.xml.
Login modules can use getGroups() to provide mappings between OC4J roles and
EIS users. The Principal interface methods support mappings between OC4J users
and EIS users. Login modules are not required to refer to the InitiatingPrincipal
and InitiatingGroup classes if they do not provide mappings between OC4J roles
and EIS users.
With JAAS, you must specify which login module to use for a particular application,
and in what order to invoke the login modules. JAAS uses values specified in
<jaas-application-name> elements to look up login modules.
This appendix discusses best practices for the OC4J security, as well as troubleshooting
issues to be aware of, and related tips:
■ Best Practices for OC4J Security
■ General OC4J Security Tips and Troubleshooting
■ Logging
■ Use Oracle Internet Directory as the central repository for the OracleAS JAAS Provider in
production environments. Although the OracleAS JAAS Provider supports a
file-based repository, it should be configured to use Oracle Identity Management,
which uses Oracle Internet Directory as its repository, for most production
environments. Oracle Internet Directory provides standard LDAP features for
modeling administrative meta data and is built on the Oracle database platform,
inheriting all the database properties of scalability, reliability, manageability, and
performance. (Alternatively, use one of the external LDAP providers that Oracle
supports.)
■ Use Oracle Single Sign-On as the authentication mechanism with the OracleAS JAAS
Provider. Various authentication options are available; however, we strongly
recommend leveraging the Oracle Single Sign-On server whenever possible
because:
– It is the default mechanism for most Oracle Application Server components,
such as Portal, Forms, Reports, and Wireless.
– It is easy to set up in a declarative fashion and does not require any custom
programming.
– It provides seamless PKI integration.
(Alternatively, use Java SSO if your installation does not include Oracle
Application Server infrastructure.)
■ Use the OracleAS JAAS Provider declarative features to reduce programming. Because
most of the features in the OracleAS JAAS Provider are controlled declaratively
(through configuration), particularly in the area of authentication, developers can
postpone setup until deployment time. This not only reduces the programming
tasks for integrating a JAAS-based application, it enables the deployer to use
environment-specific security models for that application.
■ Take advantage of the authorization features of the OracleAS JAAS Provider. In addition
to the authorization functionality defined in the JAAS 1.0 specification, the
OracleAS JAAS Provider supports:
– Hierarchical, role-based access control
– Ability to partition security policy by subscriber (that is, each user
community)
These extensions provide a more scalable and manageable framework for security
policies covering a large user population.
■ When assigning privileges to modules, use the lowest levels that are adequate to perform
the module functions. Using low-level privileges provides "fault containment"; if
security is compromised, it is contained within a small area of the network and
cannot invade the entire intranet.
■ Authorization: Oracle HTTP Server has directives that can allow access to your
application only if the end user is authenticated and authorized. Again, no code
change is required.
■ Encryption: Oracle HTTP Server can provide transparent SSL communication to
end customers without any code change on the application.
Other suggestions for securing HTTPS:
■ Configure Oracle Application Server to fail attempts to use weak encryption. You can
configure Oracle Application Server to use only specified encryption ciphers for
HTTPS connections. For example, your application could reject connections from
non-128-bit client-side SSL libraries. This ability is especially useful for banks and
other financial institutions because it provides server-side control of the
encryption strength for each connection.
■ Use HTTPS-to-HTTP appliances for accelerating HTTP over SSL. Use HTTPS
everywhere you need to. However, the significant performance overhead of
HTTPS forces a trade-off in some situations.
These appliances provide much better solutions than adding mathematics or
cryptography cards to UNIX, Windows, or Linux systems.
■ Ensure that sequential HTTPS transfers are requested through the same Web server. Most
CPU time in initiating SSL sessions is spent in the key exchange logic, where the
bulk encryption key is exchanged. If the accesses are routed to the same Web
server, caching the bulk encryption will significantly reduce CPU overhead on
subsequent accesses.
■ Keep secure pages on separate servers from pages not requiring security. Although it may
be easier to place all pages for an application on one HTTPS server, this strategy
has significant performance costs. Reserve your HTTPS server for pages needing
SSL, and put the pages not needing SSL on an HTTP server.
If secure pages are composed of many GIF, JPEG, or other files to be displayed on
the same screen, it is probably not worth the effort to segregate secure from
unsecured static content. The SSL key exchange (a major consumer of CPU cycles)
is likely to be called exactly once in any case, and the overhead of bulk encryption
is not that high.
■ Tune the Oracle HTTP ServerSSLSessionCacheTimeout directive if you are using SSL.
Oracle HTTP Server caches a client's SSL session information by default. With
session caching, only the first connection to the server incurs high latency.
The default SSLSessionCacheTimeout is 300 seconds. Note that the duration of
an SSL session is unrelated to the use of HTTP persistent connections. You can
change the SSLSessionCacheTimeout directive in the httpd.conf file to meet
your application needs.
See Also:
■ Oracle HTTP Server Administrator’s Guide
■ Realm Issues
See Also:
■ "The jazn.xml File" on page 4-9
Authentication Issues
If you attempt to log in to a protected application and authentication fails, but you
know the user and password are properly configured in the identity repository,
confirm by some other means that the identity repository is up and available, and is in
the location specified in the <jazn> element location attribute in
orion-application.xml or jazn.xml (as applicable).
Then the OracleAS JAAS Provider is probably not specified as the JAAS policy
provider.
See Also:
■ "Specification of the Oracle Policy Provider" on page 5-16
Realm Issues
This section discusses the following troubleshooting issues related to the use of realms:
■ Realm Names Omitted from User Names
■ Specifying Default Realm to Solve Authentication Failure
Logging
This section discusses logging features to aid in debugging:
■ Using Oracle Diagnostic Logging with the OracleAS JAAS Provider
■ Using Standard JDK Logging with the OracleAS JAAS Provider Admintool
See Also:
■ The following location for an overview of standard Java logging:
http://java.sun.com/j2se/1.4.2/docs/guide/util/logging
/overview.html
</HEADER>
<CORRELATION_DATA>
<EXEC_CONTEXT_ID>
<UNIQUE_ID>555.55.5.555:30508:1134589268971:0</UNIQUE_ID><SEQ>0</SEQ>
</EXEC_CONTEXT_ID>
</CORRELATION_DATA>
<PAYLOAD>
<MSG_TEXT>location=system-jazn-data.xml</MSG_TEXT>
</PAYLOAD>
</MESSAGE>
Alternatively, if you want only OracleAS JAAS Provider messages logged in the first
place, you can add configuration to j2ee-logging.xml to set the logger name to
oracle.j2ee.security, as in the following example:
<logger name="oracle.j2ee.security" level="NOTIFICATION:32"
useParentHandlers="false">
<handler name="oc4j-handler"/>
<handler name="console-handler"/>
</logger>
Using Standard JDK Logging with the OracleAS JAAS Provider Admintool
The OracleAS JAAS Provider Admintool uses standard JDK logging. To run logging
with the Admintool, change the logging level from INFO to FINE, FINER, or FINEST.
(Most log messages from the Admintool are logged at level FINE or FINER.) You can
accomplish this either by editing the JAVA_HOME/jre/lib/logging.properties
file, or by providing an updated copy of the file on the Admintool command line. The
following command executes the Admintool and provides a properties file to set an
appropriate logging level. Messages will be logged according to the configured log
handler.
% java -jar jazn.jar -Djava.util.logging.config.file=modified_logging_properties
This appendix shows versions of a sample servlet, first using standard J2EE security
APIs, then adding code to manage policy by granting permissions to a user, and finally
adding code to check permissions of a user (JAAS mode and JAAS authorization):
■ Security Configuration for Sample Servlet
■ Sample Servlet: Invoking J2EE Security APIs
■ Sample Servlet: Granting Permissions
■ Sample Servlet: Checking Permissions
See Also:
■ The following Web site for OC4J "how-to" examples:
http://www.oracle.com/technology/tech/java/oc4j/1013
/how_to/index.html
Configuration in system-jazn-data.xml
The system-jazn-data.xml file defines the developer user and the developers
role to which the user belongs, in the jazn.com realm.
The recommended way to define users and roles for the file-based provider is through
Application Server Control, as described in "Configuring the File-Based Provider in
Application Server Control" on page 7-2. You can also use the OracleAS JAAS Provider
Admintool.
<jazn-data>
...
<jazn-realm>
<realm>
<name>jazn.com</name>
<users>
...
<user>
<name>developer</name>
<display-name>developer</display-name>
<credentials>{903}CafGQDjOlPMyMiwJEwUfyjhGLAbQkzhR</credentials>
</user>
...
</users>
<roles>
...
<role>
<name>developers</name>
<display-name>Developer Role</display-name>
<members>
<member>
<type>user</type>
<name>developer</name>
</member>
</members>
</role>
...
</roles>
</realm>
</jazn-realm>
...
</jazn-data>
Configuration in web.xml
The web.xml file sets up the security constraint and defines the role
sr_developers. There is also a setting for the authentication method. (Note that it is
possible to override the authentication method in web.xml with settings in the
<jazn-web-app> element in orion-application.xml.)
<web-app>
...
<security-role>
<role-name>sr_developers</role-name>
</security-role>
...
<security-constraint>
<web-resource-collection>
<web-resource-name>CallerInfoA</web-resource-name>
<url-pattern>/callerInfoA</url-pattern>
</web-resource-collection>
<!-- authorization -->
<auth-constraint>
<role-name>sr_developers</role-name>
</auth-constraint>
</security-constraint>
...
<!-- authentication -->
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
...
</web-app>
Configuration in orion-application.xml
The orion-application.xml file specifies the file-based provider, and maps the
security role sr_developers to the role developers that is defined in the identity
store (in this case, system-jazn-data.xml).
Specify the security provider and security role mappings through Application Server
Control, as described in "Specifying a Security Provider" on page 6-9 and "Mapping
Security Roles" on page 6-10.
<orion-application>
...
<security-role-mapping name="sr_developers">
<group name="developers" />
</security-role-mapping>
...
<!-- use JAZN-XML by default -->
<jazn provider="XML" />
...
</orion-application>
public CallerInfo() {
super();
}
response.setContentType("text/html");
out.println("<HTML><BODY bgcolor=\"#FFFFFF\">");
out.println("Time stamp: " + new Date().toString());
out.println
("request.getRemoteUser = " + request.getRemoteUser() + "<br>");
out.println("request.isUserInRole('ar_developers') = " +
request.isUserInRole("sr_developers") + "<br>");
out.println
("request.getUserPrincipal = " + request.getUserPrincipal() + "<br>");
out.println("</BODY>");
out.println("</HTML>");
}
public CallerInfo() {
super();
}
out.println("</BODY>");
out.println("</HTML>");
}
See Also:
■ "Introduction to JAAS Mode" on page 5-5
import oracle.security.jazn.*;
import oracle.security.jazn.realm.*;
import oracle.security.jazn.oc4j.*;
import oracle.security.jazn.spi.Grantee;
import oracle.security.jazn.policy.*;
import javax.security.auth.*;
import java.security.*;
public CallerInfo() {
super();
}
response.setContentType("text/html");
out.println("<HTML><BODY bgcolor=\"#FFFFFF\">");
out.println("Time stamp: " + new Date().toString());
out.println
("request.getRemoteUser = " + request.getRemoteUser() + "<br>");
out.println("request.isUserInRole('ar_developers') = " +
request.isUserInRole("ar_developers") + "<br>");
out.println
("request.getUserPrincipal = " + request.getUserPrincipal() + "<br>");
//create Permission
FilePermission perm = new FilePermission("/home/developer/foo.txt","read");
}, null);
out.println("</BODY>");
out.println("</HTML>");
}
}
This chapter contains reference information for the OracleAS JAAS Provider
Admintool. It is divided into the following sections:
■ Getting Started with the Admintool
■ Summary of Admintool Command-Line Syntax and Options
■ Admintool Shell
■ Admintool Administrative Functions
Notes:
■ The Admintool can be used with either
system-jazn-data.xml or Oracle Internet Directory as the
user repository and policy repository. User and role
information in Oracle Internet Directory is read-only for the
Admintool, however.
■ Changes made by the Admintool when you are using the
file-based provider do not take effect until OC4J is restarted.
See Also:
■ "Overview of the OracleAS JAAS Provider Admintool" on
page 4-3
■ "Using Standard JDK Logging with the OracleAS JAAS Provider
Admintool" on page A-6
By default, the Admintool looks for the jazn.xml configuration file in the config
directory under your current directory. You can alter this by directly specifying a
location through the oracle.security.jazn.config system property, or by
specifying an Oracle home or J2EE home location through the oracle.home property
or oracle.j2ee.home property, respectively. The precedence of search locations is
described in "The jazn.xml File" on page 4-9.
The following example specifies the location of the jazn.xml file:
% java -jar -Doracle.security.jazn.config=/tmp/jazn.xml jazn.jar ...
The next example specifies the J2EE home location, where ORACLE_HOME is the path to
the Oracle home directory, and instancename is the name of the OC4J instance (such
as home, for example). Based on this, the Admintool will look for jazn.xml in the
ORACLE_HOME/j2ee/instancename/config directory:
% java -jar -Doracle.j2ee.home=ORACLE_HOME/j2ee/instancename jazn.jar ...
When you use Oracle Identity Management, the <jazn> location attribute specifies
the Oracle Internet Directory location, such as in the example that follows. However,
do not manually update the location value when you use Oracle Identity
Management; this value is set automatically when you associate the Oracle Internet
Directory instance with OC4J through Application Server Control (as described in
"Associating Oracle Internet Directory with OC4J" on page 8-6). Here is an example:
<jazn provider="LDAP" location="ldap://myoid.oracle.com:389" default-realm="us" >
...
</jazn>
■ The recommended way is to not supply -user and -password settings on the
command line; Admintool will then prompt you for a user name and password, as
in this example:
% java -jar jazn.jar ...
AbstractLoginModule username: username
AbstractLoginModule password: password
...
In this mode, any options you specify are executed only after you have been
prompted for and have supplied the user name and password. For example:
% java -jar jazn.jar -listrealms
When an example such as this is presented in this appendix, what is left unsaid is
that you will be prompted for the user name and password before the command is
executed (in this example, before the realms are listed).
■ Alternatively, you can use the -user and -password options on the command
line:
% java -jar jazn.jar -user username -password password...
In either of these modes, once the options you specify on the command line have been
executed, you are returned to your system prompt. To execute any further Admintool
commands, you will have to rerun the tool and be authenticated again.
To run multiple commands without reauthenticating, you can use the Admintool shell
mode, where you can repeatedly run commands from the Admintool prompt until you
exit the shell, as described in "Admintool Shell" on page C-6.
Important:
■ If you use the -user and -password options (which is not
recommended, as discussed in the preceding section), you must
specify them before all other options on the command line.
■ Restart OC4J for Admintool changes to take effect.
This section lists all the Admintool command options, with cross-references for further
information. You can also list all the options and their syntax with the -help option:
% java -jar jazn.jar -help
See Also:
■ "Administrative Operations" on page C-13
■ Authentication options
-user username -password password
See Also:
■ "Authentication for the Admintool" on page C-2
See Also:
■ "Adding and Removing Login Modules" on page C-10
■ "Listing Login Modules" on page C-15
■ Migration option
-convert filename realm
See Also:
■ "Converting from the principals.xml File to JAAS" on page C-17
See Also:
■ "Checking Passwords (File-Based Provider Only)" on page C-13
■ "Setting Passwords (File-Based Provider Only)" on page C-13
■ Policy options
-grantperm {realm {-user user|-role role} | principal_class principal_params}
permission_class [permission_params]
-listperms {realm {-user user|-role role} | principal_class principal_params}
permission_class [permission_params]
-revokeperm {realm {-user user|-role role} | principal_class principal_params}
permission_class [permission_params]
See Also:
■ "Granting and Revoking Permissions" on page C-14
■ "Listing Permissions" on page C-15
See Also:
■ "Adding and Removing Realms (File-Based Provider Only)" on
page C-11
■ "Adding and Removing Roles (File-Based Provider Only)" on
page C-12
■ "Adding and Removing Users (File-Based Provider Only)" on
page C-12
See Also:
■ "Granting and Revoking Roles" on page C-14
■ "Listing Realms" on page C-16
■ "Listing Roles" on page C-16
■ "Listing Users" on page C-16
■ Shell option
-shell
See Also:
■ The next section, "Admintool Shell"
Admintool Shell
The Admintool shell provides interactive administration of JAAS principals and
policies through a UNIX-like interface. The -shell option starts the shell. For
example (entering the oc4jadmin user and password when prompted):
% java -jar jazn.jar -shell
AbstractLoginModule username: oc4jadmin
AbstractLoginModule password: password
JAZN:>
The shell responds with the JAZN:> prompt. To leave the interface shell, use the exit
shell command. To see a list of shell commands, use the help command. For
information about a particular shell command, the shell supports the man command:
JAZN:> man admintoolcommand
Is equivalent to an Admintool command line (from your system prompt) such as the
following:
% java -jar jazn.jar -option1 -option2 ... -optionN
In this structure, the user and role nodes are linked together. This means that the
roles link under user is the same link as the roles link under realm. In Unix
terms, the role at numeral 1 in the diagram is a symbolic link to role at numeral 2 in
the diagram.
The add, mkdir, and mk commands are equivalent; they each create a subdirectory or
node under the current directory. The effect of the command depends on the current
directory location. For example, if the current directory is the root, then the command
creates a realm. If the current directory is /realm/users, then the command creates a
user. Depending on the situation, these commands would be equivalent to Admintool
commands such as -addrealm and -adduser.
When executed under the directory /realms, this shell command is equivalent to the
following:
% java -jar jazn.jar -addrealm myrealm myuser mypassword myrole
The cd command enables users to navigate the directory tree. Relative and absolute
path names are supported.
The path "/" returns the user to the root node.
An error message is displayed if the specified directory does not exist.
The clear command clears the terminal screen by displaying 80 blank lines.
The ls command lists the contents of the current directory or node. For example, if the
current directory is the root, then ls lists all realms. If the current directory is
/realm/users, then ls lists all users in the realm. The results of the listing depends
on the current directory. The ls command can operate with the * wildcard.
The man command displays detailed usage information for the specified shell
command or Admintool command option.
The pwd command displays the current location of the user in the directory tree.
Undefined values are left blank in this listing.
The rm command removes the directory or node in the current directory. The effect of
the command depends on the current directory. For example, if the current directory is
the root, then rm removes the specified realm. If the current directory is
/realm/users, it removes the specified user. An error message is displayed if the
specified name does not exist.
The rm command accepts the * wildcard.
The set command updates the value of the specified name. For example, use this
command to update the login module class, or a login module control flag, or a login
module class option, depending on the working directory.
The -addloginmodule option configures a new login module for the named
application.
The control_flag must be one of required, requisite, sufficient or
optional, as specified in the standard
javax.security.auth.login.Configuration class. The meanings of these flag
values are summarized in Table 9–5, " Login Module Control Flags" on page 9-17.
If the login module accepts its own options, specify each option and its value as an
optionname=value pair. Each login module has its own individual set of options.
For example, to add MyLoginModule to the application myapp as a required module,
and where the login module supports a debug option:
% java -jar jazn.jar -addloginmodule myapp MyLoginModule required debug=true
Admintool shell:
JAZN:> addloginmodule myapp MyLoginModule required debug=true
JAZN:> remloginmodule myapp MyLoginModule
The -addrealm option creates a realm with the specified name and specified
administrator.
For the file-based provider, specify the name of the realm, the realm administrator, the
administrator password, and the administrator role:
-addrealm realm admin adminpwd adminrole
See Also:
■ "Overview of Delegated Administration Services" on page 4-4
■ Oracle Identity Management Guide to Delegated Administration
For example, to create a realm employees with administrator martha, who has
password mypass and is a member of role hr:
% java -jar jazn.jar -addrealm employees martha mypass hr
Admintool shell:
JAZN:> addrealm employees martha mypass hr
JAZN:> remrealm employees
The -addrole option creates a role in the specified realm; the -remrole option
deletes a role from the realm.
For example, to add the role roleFoo to the realm foo:
% java -jar jazn.jar -addrole foo fooRole
Admintool shell:
JAZN:> addrole foo fooRole
JAZN:> remrole foo fooRole
The -adduser option adds a user to a specified realm; the -remuser option deletes a
user from the realm.
It is recommended that you add users through the Admintool shell instead of on the
command line, as in the following example:
% java -jar jazn.jar -shell
AbstractLoginModule username : oc4jadmin
AbstractLoginModule password : adminpassword
JAZN:> adduser jazn.com my_user my_password
Entering a user on the Admintool command line is less secure. For example, on a
UNIX system, any other user on the system could see the password by using the "ps
-ef" command to list all processes. By contrast, commands entered in the Admintool
shell are read only by the Admintool.
However, adding a user on the command line is supported as well. For example, to
add the user martha to the realm foo with the password mypass:
% java -jar jazn.jar -adduser foo martha mypass
To insert a user with no password, end the command line with the -null option:
jazn -jar jazn.jar -adduser foo martha -null
Admintool shell:
JAZN:> adduser foo martha mypass
JAZN:> remuser foo martha
The -setpasswd option enables administrators to reset the password of a user, given
the old password.
For example, to change the user martha in realm foo from password mypass to
password a2d3vn:
% java -jar jazn.jar -setpasswd foo martha mypass a2d3vn
Admintool shell:
JAZN:> setpasswd foo martha mypass a2d3vn
The -checkpasswd option indicates whether the given user requires a password for
authentication.
When you specify -checkpasswd alone, the Admintool responds "A password exists
for this principal" if the user has a password, or "No password exists for tis principal"
if the user has no password.
When you specify -checkpasswd together with a -pw parameter for a password, the
Admintool responds "Successful verification of user/password pair" if the user name
and password pair are correct, or "Unsuccessful verification of user/password pair" if
user name or password is incorrect.
For example, to check whether the user martha in realm foo uses the password
Hello:
% java -jar jazn.jar -checkpasswd foo martha -pw Hello
Admintool shell:
JAZN:> checkpasswd foo martha -pw Hello
Administrative Operations
-activateadmin
Admintool shell:
JAZN:> activateadmin password
See Also:
■ "Activation of the oc4jadmin Account (Standalone OC4J)" on
page 4-12
Note: If the Admintool gives the error message "Permission class not
found," it means that the permission you wish to grant is not in the
classpath. See "Using Custom Principals and Permissions with the
Admintool" on page C-3.
Admintool shell:
JAZN:> grantperm foo -user martha java.io.FilePermission a.txt read,write
JAZN:> revokeperm foo -user martha java.io.FilePermission a.txt read,write
The -grantrole option grants the specified role to a user (when called with a user
name) or a role (when called with -role). The -revokerole option revokes the
specified role from a user or role.
For example, to grant the role editor to the user martha in realm foo:
% java -jar jazn.jar -grantrole editor foo martha
Admintool shell:
JAZN:> grantrole editor foo martha
JAZN:> revokerole editor foo martha
The -listloginmodules option displays all login modules either in the specified
application_name or, if no application_name is specified, in all applications.
Specifying login_module_class after application_name displays information
on only the specified class within the application.
For example, to display all login modules for the application myapp:
% java -jar jazn.jar -listloginmodules myapp
Admintool shell:
JAZN:> listloginmodules myapp
Listing Permissions
-listperms {realm {-user user | -role role} | principal_class principal_params
permission_class [permission_params]
The -listperms option displays all permissions that match the list criteria, as
follows:
■ Permissions that are granted to a user when the -user option is used
■ Permissions that are granted to a role when a -role option is used
■ Permissions that are granted to a principal
Always specify a realm when you list permissions for a user or role, but not when you
list permissions for a principal.
For example, to display all permissions for the user martha in realm foo:
% java -jar jazn.jar -listperms foo -user martha
Admintool shell:
Listing Realms
-listrealms [realm]
The -listrealms option displays all realms in the current JAAS environment; or, if a
realm argument is specified, the option lists only that realm.
For example, to list all realms:
% java -jar jazn.jar -listrealms
Admintool shell:
JAZN:> listrealms
Listing Roles
-listroles [realm [user | -role role]]
The -listroles option displays a list of roles that match the list criteria. This option
lists:
■ All roles in all realms, when called without any parameters
■ All roles granted to a user, when called with a realm name and user name
■ All roles granted to the specified role, when called with a realm name and the
option -role
For example, to list all roles in realm foo:
% java -jar jazn.jar -listroles foo
Admintool shell:
JAZN:> listroles foo
Listing Users
-listusers [realm [-role role | -perm permission]]
The -listusers option displays a list of users that match the list criteria. This option
lists:
■ All users in all realms, when called without any parameters
■ All users in a realm, when called with a realm name
■ Users that are granted a certain role or permission, when called with a realm name
and the option -role or -perm
For example, to list all users in realm foo:
% java -jar jazn.jar -listusers foo
anonymous
Admintool shell:
JAZN:> listusers foo
The -convert option migrates the principals.xml file into the specified realm of
the current OracleAS JAAS Provider. The filename argument specifies the path
name of the input file (typically
ORACLE_HOME/j2ee/home/config/principals.xml). For example:
% java -jar jazn.jar \
-convert $ORACLE_HOME/j2ee/home/config/principals.xml jazn.com
Admintool shell:
JAZN:> convert ORACLE_HOME/j2ee/home/config/principals.xml jazn.com
See Also:
■ "Migrating Principals from the principals.xml File" on page 7-16
for important additional information
Hierarchy of jazn.xml
The jazn.xml file has a simple hierarchy, as follows:
<jazn>
<property>
See Also:
■ "The jazn.xml File" on page 4-9 for an overview of this file
Note: Where attributes are discussed, note that attribute values are
always set inside quotes: attribute="value".
See Also:
■ "The jazn.xml File" on page 4-9 for an overview of this file
<jazn>
Parent element: n/a (root)
Note: This element (optionally with any of its subelements) may also
appear in an orion-application.xml file for application-level
settings.
<property>
Parent element: <jazn>
Hierarchy of system-jazn-data.xml
This section shows the element hierarchy of the system-jazn-data.xml file. The
immediate subelements of <jazn-data> are <jazn-policy>, <jazn-realm>,
<jazn-loginconfig>, <jacc-repository>, <jazn-permission-classes>,
and <jazn-principal-classes>, but the latter three are not intended for customer
use in this release.
Hierarchy of system-jazn-data.xml
<jazn-data>
Hierarchy of system-jazn-data.xml
<jazn-policy>
<grant>
<grantee>
<display-name>
<principals>
<principal>
<realm-name>
<type>
<class>
<name>
<codesource>
<url>
<permissions>
<permission>
<class>
<name>
<actions>
<jazn-realm>
<realm>
<name>
<users>
<user>
<name>
<display-name>
<description>
<guid>
<credentials>
<roles>
<role>
<name>
<display-name>
<description>
<guid>
<members>
<member>
<type>
<name>
<jazn-policy> DO NOT USE AS SUBELEMENT OF <realm>
<jazn-loginconfig>
<application>
<name>
<login-modules>
<login-module>
<class>
<control-flag>
<options>
<option>
<name>
<value>
<jacc-repository> NOT INTENDED FOR CUSTOMER USE; SUBHIERARCHY NOT SHOWN
<jazn-permission-classes> NOT INTENDED FOR CUSTOMER USE; SUBHIERARCHY NOT SHOWN
<jazn-principal-classes> NOT INTENDED FOR CUSTOMER USE; SUBHIERARCHY NOT SHOWN
See Also:
■ "The system-jazn-data.xml File" on page 4-7 for an overview of
this file
■ "Application-Specific jazn-data.xml File (Optional)" on page 4-8
Notes:
■ Elements under <jazn-realm> can also be used in an
application-specific jazn-data.xml file.
■ Most settings in system-jazn-data.xml can be made through
Application Server Control, as documented elsewhere in this
document.
■ Where attributes are discussed, note that attribute values are
always set inside quotes: attribute="value".
See Also:
■ "The system-jazn-data.xml File" on page 4-7 for an overview of
this file
■ "Application-Specific jazn-data.xml File (Optional)" on page 4-8
<actions>
Parent element: <permission>
<application>
Parent element: <jazn-loginconfig>
See Also:
■ <jazn-loginconfig> on page D-11 for an example
<class>
Parent element: <principal>, <permission>, or <login-module>
■ Within the <login-module> element, it specifies the fully qualified name of the
login module class. For example:
<class>
oracle.security.jazn.login.module.db.DBTableOraDataSourceLoginModule
</class>
<codesource>
Parent element: <grantee>
<control-flag>
Parent element: <login-module>
<control-flag>requisite</control-flag>
<control-flag>sufficient</control-flag>
<control-flag>optional</control-flag>
See Also:
■ Table 9–5, " Login Module Control Flags" on page 9-17 for
additional information about the control flag settings
■ <jazn-loginconfig> on page D-11 for an example
<credentials>
Parent element: <user>
<credentials>!welcome</credentials>
See Also:
■ <jazn-realm> on page D-14 for an example
■ "Password Obfuscation in OC4J Configuration Files" on page 6-3
<description>
Parent element: <user> or <role>
<display-name>
Parent element: <grantee>, <user>, or <role>
<grant>
Parent element: <jazn-policy>
See Also:
■ <jazn-policy> on page D-12 for an example
<grantee>
Parent element: <grant>
See Also:
■ <jazn-policy> on page D-12 for an example
<guid>
Parent element: <user> or <role>
<jacc-repository>
Parent element: <jazn-data>
Required? n/a
This element and its subhierarchy (shown here) are not intended for customer use in
the OC4J 10.1.3.1 implementation.
<jacc-repository>
<jacc-policy>
<contextID>
<excluded-policy> SAME SUBHIERARCHY AS <jazn-policy>
<unchecked-policy> SAME SUBHIERARCHY AS <jazn-policy>
<role-policy> SAME SUBHIERARCHY AS <jazn-policy>
<jazn-data>
Parent element: n/a (root)
<jazn-loginconfig>
Parent element: <jazn-data>
<value>role</value>
</option>
<option>
<name>user_pk_column</name>
<value>userName</value>
</option>
<option>
<name>passwordField</name>
<value>passWord</value>
</option>
<option>
<name>groupMembershipTableName</name>
<value>groupinfo</value>
</option>
<option>
<name>usernameField</name>
<value>userName</value>
</option>
<option>
<name>casing</name>
<value>sensitive</value>
</option>
</options>
</login-module>
</login-modules>
</application>
...
</jazn-loginconfig>
<jazn-permission-classes>
Parent element: <jazn-data>
Required? n/a
This element and its subhierarchy (shown here) are not intended for customer use in
the OC4J 10.1.3.1 implementation.
<jazn-permission-classes>
<permission-class>
<name>
<description>
<type>
<class>
<target-descriptors>
<target-descriptor>
<name>
<description>
<action-descriptors>
<action-descriptor>
<name>
<description>
<jazn-policy>
Parent element: <jazn-data>
</jazn-policy>
<jazn-principal-classes>
Parent element: <jazn-data>
Required? n/a
This element and its subhierarchy (shown here) are not intended for customer use in
the OC4J 10.1.3.1 implementation.
<jazn-principal-classes>
<principal-class>
<name>
<description>
<type>
<class>
<name-description-map>
<name-description-pair>
<name>
<description>
<jazn-realm>
Parent element: <jazn-data>
<name>ascontrol_admin</name>
<display-name>ASControl Admin Role</display-name>
<description>Administrative role for ASControl</description>
<guid>D3DB1C05D3E311DABFFC25CB9F57C041</guid>
<members>
<member>
<type>user</type>
<name>oc4jadmin</name>
</member>
</members>
</role>
<role>
<name>oc4j-administrators</name>
<display-name>OC4J Admin Role</display-name>
<description>Administrative role for OC4J</description>
<guid>D3DB1C02D3E311DABFFC25CB9F57C041</guid>
<members>
<member>
<type>user</type>
<name>oc4jadmin</name>
</member>
...
</members>
</role>
...
</roles>
</realm>
</jazn-realm>
<login-module>
Parent element: <login-modules>
See Also:
■ <jazn-loginconfig> on page D-11 for an example
<login-modules>
Parent element: <application>
See Also:
■ <jazn-loginconfig> on page D-11 for an example
<member>
Parent element: <members>
See Also:
■ <jazn-realm> on page D-14 for an example
<members>
Parent element: <role>
See Also:
■ <jazn-realm> on page D-14 for an example
<name>
Parent element: <principal>, <realm>, <role>, <user>, <member>, <application>, or
<option>
■ Within the <user> element, it specifies the unique name of a user in the
applicable realm. For example:
<name>oc4jadmin</name>
■ Within the <role> element, it specifies the unique name of a role in the applicable
realm. For example:
<name>oc4j-administrators</name>
■ Within the <application> element, it specifies the fully qualified name of the
application whose login modules are being configured. For example:
<name>oracle.security.jazn.tools.Admintool</name>
■ Within the <option> element, it specifies the name of an option for configuration
of a login module. (There is an accompanying <value> element for the option
value.) For example, an option for DBTableOraDataSourceLoginModule:
<option>
<name>data_source_name</name>
<value>jdbc/OracleDS</value>
</option>
<name>
Parent element: <permission>
<option>
Parent element: <options>
See Also:
■ <jazn-loginconfig> on page D-11 for an example
<options>
Parent element: <login-module>
See Also:
■ <jazn-loginconfig> on page D-11 for an example
<permission>
Parent element: <permissions>
See Also:
■ <jazn-policy> on page D-12 for an example
<permissions>
Parent element: <grant>
See Also:
■ <jazn-policy> on page D-12 for an example
<principal>
Parent element: <principals>
See Also:
■ <jazn-policy> on page D-12 for an example
<principals>
Parent element: <grantee>
See Also:
■ <jazn-policy> on page D-12 for an example
<realm>
Parent element: <jazn-realm>
See Also:
■ <jazn-realm> on page D-14 for an example
<realm-name>
Parent element: <principal>
For granting permissions to a principal, this element specifies the name of the realm to
which the principal belongs. (Its value would correspond to the value of a <name>
subelement of a <realm> element where the realm is configured.) For example:
<realm-name>jazn.com</realm-name>
<role>
Parent element: <roles>
See Also:
■ <jazn-realm> on page D-14 for an example
<roles>
Parent element: <realm>
See Also:
■ <jazn-realm> on page D-14 for an example
<type>
Parent element: <member>
See Also:
■ <jazn-realm> on page D-14 for an example
<type>
Parent element: <principal>
See Also:
■ <jazn-policy> on page D-12 for an example
<url>
Parent element: <codesource>
(This follows the same format as shown for a java2.policy file in "Creating or
Updating a Java 2 Policy File" on page 5-3.)
<user>
Parent element: <users>
See Also:
■ <jazn-realm> on page D-14 for an example
<users>
Parent element: <realm>
See Also:
■ <jazn-realm> on page D-14 for an example
<value>
Parent element: <option>
This appendix includes the Third Party License for third party products included with
Oracle Application Server.
Apache
This program contains third-party code from the Apache Software Foundation
("Apache"). Under the terms of the Apache license, Oracle is required to provide the
following notices. Note, however, that the Oracle program license that accompanied
this product determines your right to use the Oracle program, including the Apache
software, and the terms contained in the following notices do not change those rights.
The Apache license agreements apply to the following included Apache components:
■ Apache HTTP Server
■ Apache JServ
■ mod_jserv
■ Regular Expression package version 1.3
■ Apache Expression Language packaged in commons-el.jar
■ mod_mm 1.1.3
■ Apache XML Signature and Apache XML Encryption v. 1.4 for Java and 1.0 for
C++
■ log4j 1.1.1
■ BCEL v. 5
■ XML-RPC v. 1.1
■ Batik v. 1.5.1
■ ANT 1.6.2 and 1.6.5
■ Crimson v. 1.1.3
■ ant.jar
■ wsif.jar
■ bcel.jar
■ soap.jar
■ Jakarta CLI 1.0
■ jakarta-regexp-1.3.jar
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
Apache SOAP
This program contains third-party code from the Apache Software Foundation
("Apache"). Under the terms of the Apache license, Oracle is required to provide the
following notices. Note, however, that the Oracle program license that accompanied
this product determines your right to use the Oracle program, including the Apache
software, and the terms contained in the following notices do not change those rights.
Notwithstanding anything to the contrary in the Oracle program license, the Apache
software is provided by Oracle "AS IS" and without warranty or support of any kind
from Oracle or Apache.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
mod_mm
Copyright (c) 1999 - 2000 Ralf S. Engelschall. All rights reserved.
This product includes software developed by Ralf S. Engelschall
<[email protected]> for use in the mod_ssl project (http://www.modssl.org/).
mod_ssl
Copyright (c) 1998-2001 Ralf S. Engelschall. All rights reserved.
This product includes software developed by Ralf S. Engelschall
<[email protected]> for use in the mod_ssl project (http://www.modssl.org/).
OpenSSL
This program contains third-party code from the OpenSSL Project. Under the terms of
the OpenSSL Project license, Oracle is required to provide the following notices. Note,
however, that the Oracle program license that accompanied this product determines
your right to use the Oracle program, including the OpenSSL software, and the terms
contained in the following notices do not change those rights.
OpenSSL License
/* ====================================================================
* Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* [email protected].
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT "AS IS" AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* ([email protected]). This product includes software written by Tim
* Hudson ([email protected]).
*
*/
Perl
This program contains third-party code from the Comprehensive Perl Archive
Network ("CPAN"). Under the terms of the CPAN license, Oracle is required to
provide the following notices. Note, however, that the Oracle program license that
accompanied this product determines your right to use the Oracle program, including
the CPAN software, and the terms contained in the following notices do not change
those rights.
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
Copyright (c) 1999-2004, The Apache Software Foundation
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
Preamble
The intent of this document is to state the conditions under which a Package may be
copied, such that the Copyright Holder maintains some semblance of artistic control
over the development of the package, while giving the users of the package the right
to use and distribute the Package in a more-or-less customary fashion, plus the right to
make reasonable modifications.
Definitions
"Package" refers to the collection of files distributed by the Copyright Holder, and
derivatives of that collection of files created through textual modification.
"Standard Version" refers to such a Package if it has not been modified, or has been
modified in accordance with the wishes of the Copyright Holder as specified below.
"Copyright Holder" is whoever is named in the copyright or copyrights for the
package.
"You" is you, if you're thinking about copying or distributing this Package.
"Reasonable copying fee" is whatever you can justify on the basis of media cost,
duplication charges, time of people involved, and so on. (You will not be required to
justify it to the Copyright Holder, but only to the computing community at large as a
market that must bear the fee.)
"Freely Available" means that no fee is charged for the item itself, though there may be
fees involved in handling the item. It also means that recipients of the item may
redistribute it under the same conditions they received it.
1. You may make and give away verbatim copies of the source form of the Standard
Version of this Package without restriction, provided that you duplicate all of the
original copyright notices and associated disclaimers.
2. You may apply bug fixes, portability fixes and other modifications derived from
the Public Domain or from the Copyright Holder. A Package modified in such a
way shall still be considered the Standard Version.
3. You may otherwise modify your copy of this Package in any way, provided that
you insert a prominent notice in each changed file stating how and when you
changed that file, and provided that you do at least ONE of the following:
a. place your modifications in the Public Domain or otherwise make them Freely
Available, such as by posting said modifications to Usenet or an equivalent
medium, or placing the modifications on a major archive site such as
uunet.uu.net, or by allowing the Copyright Holder to include your
modifications in the Standard Version of the Package.
b. use the modified Package only within your corporation or organization.
c. rename any non-standard executables so the names do not conflict with
standard executables, which must also be provided, and provide a separate
manual page for each non-standard executable that clearly documents how it
differs from the Standard Version.
d. make other distribution arrangements with the Copyright Holder.
4. You may distribute the programs of this Package in object code or executable form,
provided that you do at least ONE of the following:
a. distribute a Standard Version of the executables and library files, together with
instructions (in the manual page or equivalent) on where to get the Standard
Version.
b. accompany the distribution with the machine-readable source of the Package
with your modifications.
c. give non-standard executables non-standard names, and clearly document the
differences in manual pages (or equivalent), together with instructions on
where to get the Standard Version.
d. make other distribution arrangements with the Copyright Holder.
5. You may charge a reasonable copying fee for any distribution of this Package. You
may charge any fee you choose for support of this Package. You may not charge a
fee for this Package itself. However, you may distribute this Package in aggregate
with other (possibly commercial) programs as part of a larger (possibly
commercial) software distribution provided that you do not advertise this Package
as a product of your own. You may embed this Package's interpreter within an
executable of yours (by linking); this shall be construed as a mere form of
aggregation, provided that the complete Standard Version of the interpreter is so
embedded.
6. The scripts and library files supplied as input to or produced as output from the
programs of this Package do not automatically fall under the copyright of this
Package, but belong to whoever generated them, and may be sold commercially,
and may be aggregated with this Package. If such scripts or library files are
aggregated with this Package through the so-called "undump" or "unexec"
methods of producing a binary executable image, then distribution of such an
image shall neither be construed as a distribution of this Package nor shall it fall
under the restrictions of Paragraphs 3 and 4, provided that you do not represent
such an executable image as a Standard Version of this Package.
7. C subroutines (or comparably compiled subroutines in other languages) supplied
by you and linked into this Package in order to emulate subroutines and variables
of the language defined by this Package shall not be considered part of this
Package, but are the equivalent of input as in Paragraph 6, provided these
subroutines do not change the language in any way that would cause it to fail the
regression tests for the language.
8. Aggregation of this Package with a commercial distribution is always permitted
provided that the use of this Package is embedded; that is, when no overt attempt
is made to make this Package's interfaces visible to the end user of the commercial
distribution. Such use shall not be construed as a distribution of this Package.
9. The name of the Copyright Holder may not be used to endorse or promote
products derived from this software without specific prior written permission.
10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
PURPOSE.
The End
Index-1
configuring, 4-15 C
application element, system-jazn-data.xml, D-6
application roles, 3-8 caching, LDAP
Application Server Control caching properties, 8-22
configuring Java SSO, 14-8 disabling, 8-23
configuring security provider, 6-9 callback handler
configuring security role mappings, 6-11 identity callback handler interface, identity
overview, 4-2 management framework, 13-9
as-context element, orion-ejb-jar.xml, 19-6 identity callback handler, identity management
authentication framework, 13-3
authenticating EJB applications, 18-1 standard definition, 2-14
authentication methods for Web capability model of access control, 1-2
applications, 17-1 case-sensitivity for roles
basic method, 17-1 custom login modules, 9-3
client-cert method, 17-5 external LDAP providers, 10-2
definition, 1-1 file-based provider, 7-1
digest method, 17-1 LDAP-based provider, 8-2
digest method, with Oracle Internet cd command, Admintool shell, C-9
Directory, 8-15 certificates and certificate authorities (SSL)
failure, specify default realm, A-5 introduction, 1-5
form-based method, 17-4 trust points, 1-4
in OC4J, introduction, 3-5 truststores, 19-1
login modules, 2-13 using certificates with OC4J and Oracle HTTP
OracleAS Single Sign-On, 3-3 Server, 15-2
RealmLoginModule class, 3-3 checkpasswd option, Admintool, C-13
SSL authentication, 1-4 cipher suites
SSO method, 8-14 definition, 16-4
supported authentication methods, 2-2 specify in Web site XML file, 15-8
authorization supported by JSSE, 16-4
authorization APIs and JAAS mode, 5-4 class element, system-jazn-data.xml, D-7
authorizing EJB applications, 18-1 class loading, sharing libraries, 6-14
coarse-grained vs. fine-grained, 2-17 clear command, Admintool shell, C-9
comparing models--overview, 2-17 client-cert authentication
definition, 1-2 definition, 2-2
enabling Java Authorization Contract for in OC4J, 17-5
Containers, 5-19 Cluster MBean Browser, 7-18
J2EE authorization APIs, 5-16 CN (common name), 8-3
Java 2 code-based policy management, 5-1 coarse-grained authorization, 2-17
obtaining a subject, 5-17 codebase, 2-8
policy configuration, OracleAS JAAS code-based security, 2-8
Provider, 5-14 codesource, 2-8
policy management, OracleAS JAAS codesource element, system-jazn-data.xml, D-7
Provider, 5-12 common name (CN), 8-3
strategies, 5-20 Common Secure Interoperability version 2--see CSIv2
to any authenticated user (PUBLIC role), 6-12 component-managed sign-on (J2CA)
using checkPermission(), 5-17 understanding, 20-6
authorization--also see access control vs. container-managed sign-on, 20-2
confidentiality element, orion-ejb-jar.xml, 19-5
connection properties, LDAP, 8-21
B connector-factory element, oc4j-ra.xml (J2CA), 9-24
basic authentication container-managed sign-on (J2CA)
as fallback in digest authentication mode, 17-3 authentication, 20-9
configuring in web.xml, 17-1 declarative, 20-9
definition, 2-2 programmatic, 20-12
in Oracle Access Manager, 11-10 understanding, 20-7
best practices for security, A-1 vs. component-managed sign-on, 20-2
bootstrap accounts, 4-11 control-flag element, system-jazn-data.xml, D-7
bootstrap jazn.xml, 4-9 convert option, Admintool, 7-16, C-17
cookie domain for shared Web application, 15-8
COREid--see Oracle Access Manager
credential_mapping plug-in, Oracle Access
Index-2
Manager, 11-10, 11-11 E
credentials element, system-jazn-data.xml, D-8
credentials, specifying in EJB clients, 18-9 EJB
CSIv2 anonymous lookup, 18-11
ejb_sec.properties settings, 19-3 authenticating and authorizing EJB
internal-settings.xml settings, 19-1 applications, 18-1
introduction, 19-1 client security properties for CSIv2, 19-3
properties in orion-ejb-jar.xml, 19-5 granting permissions in browser, 18-11
custom login modules--see login modules JNDI security providers, 18-9
custom security providers (custom login namespace access, 18-8
modules), 3-4 RMI client access, 18-10
server security properties for CSIv2, 19-1
troubleshooting, 18-3
D ejb_sec.properties, CSIv2 security properties (EJB
DAS (Delegated Administration Services for client-side), 19-3
OID), 4-4 ejb-jar.xml
database login module, 9-5 configuring J2EE security roles, 3-8
DataSourceUserManager (deprecated), 9-11 Enterprise Manager--see Application Server Control
DBTableOraDataSourceLoginModule (database login establish-trust-in-client element,
module), 9-5 orion-ejb-jar.xml, 19-6
deactivated user (file-based provider), 4-12 establish-trust-in-target element,
debugging orion-ejb-jar.xml, 19-6
general SSL debugging, 15-18 exit command, Admintool shell, C-9
logging, A-5 external LDAP providers
PrintingSecurityManager, 5-3 administrator user and roles, creating, 10-9
default realm, file-based or LDAP-based configuring in Application Server Control, after
provider, 6-4 deployment, 10-5
default-method-access element, configuring in Application Server Control, during
orion-ejb-jar.xml, 18-8 deployment, 10-3
Delegated Administration Services (DAS for granting RMI permission to LDAP principal, 10-9
OID), 4-4 introduction, 3-4
deployment overview, configuration and administration, 10-2
configuring the security provider through Sun Java System Directory Server
Application Server Control, 6-9 (example), 10-10
deploying an application through Application system-jazn-data.xml, login-module element
Server Control, 6-8 options, 10-6
deploying login modules, 9-27 troubleshooting, 10-2
deployment plan, 4-1 external.synchronization property (no longer
deployment plan editor, 4-2 supported), xxviii
JSR-88 support, 4-1
standards for deploying applications, 4-1 F
tasks and guidelines, 6-7
file-based provider
deployment roles, 3-8
activating/deactivating users, 4-12
description element, system-jazn-data.xml, D-9
administering instance-level security, 7-8
digest authentication
configuring as security provider after
basic authentication fallback, 17-3
deployment, 7-3
configuring in web.xml, 17-1
configuring as security provider during
definition, 2-2
deployment, 7-3
with Oracle Internet Directory, 8-15
configuring in Application Server Control, 7-2
digest.auth.basic.fallback property, 17-3
default realm, 6-4
digital certificates, 1-4
introduction, 3-3
display-name element, system-jazn-data.xml, D-9
migrating from principals.xml, 7-16
distinguished name (DN), 8-3
migration tool, migrating from file-based provider
DN (distinguished name), 8-3
(to LDAP-based or alternative
doAs() and doAsPrivileged()
file-based), 7-13
method descriptions, 2-15
policy management, 7-2
with JAAS mode, 5-5
realm management, 7-2, 7-11
doasprivileged-mode (obsolete setting), 5-6
settings in OC4J configuration files, 7-9
doPrivileged() method, AccessController, 2-11
fine-grained authorization, 2-17
form-based authentication
Index-3
configuration in web.xml, 17-4 identity management realms (OID)
definition, 2-2 introduction, 8-16
in Oracle Access Manager, 11-8 managing, 8-18
relation to JAAS Provider realms, 8-17
using multiple realms, 8-19
G
identity propagation, 2-7
globally unique identifier (GUID), D-10 identity store, 13-4
grant element, system-jazn-data.xml, D-9 identity token interface, identity management
grantee element, system-jazn-data.xml, D-9 framework, 13-6
grantperm option, Admintool, C-14 identity token, identity management
grantrole option, Admintool, C-14 framework, 13-2
Group class (deprecated), 5-8, 12-2 indirect passwords, 6-1
groups, OC4J instances instance-level security, file-based provider, 7-8
adding, administering, 7-17 integrity element, orion-ejb-jar.xml, 19-5
J2EEServerGroup MBean, 7-18 internal-settings.xml
GUID (globally unique identifier), D-10 CSIv2 security properties (EJB server-side), 19-1
guid element, system-jazn-data.xml, D-10 DTD, 19-3
sep-property element, 19-1
H
help command, Admintool shell, C-9 J
host name verifier (HTTPClient), 16-8 J2CA, J2EE Connector Architecture--see resource
HTTPClient adapters
divergence from open source version, 16-2 J2EE roles, 3-8
SSL host name verification, 16-8 J2EEServerGroup MBean (OC4J groups), 7-18
using with JSSE, 16-6 JAAS (Java Authentication and Authorization
HTTPConnection class, 16-2 Service), 2-12
HTTPS for client connections JAAS mode
HTTPClient example, JSSE, 16-7 configuring and using, 5-18
Oracle HTTPS features, 16-2 introduction, 5-5
Oracle HTTPS system properties, 16-5 required for subject propagation, 18-14
JAAS provider
I integration with SSL-enabled applications, 15-2
integration with SSO-enabled applications, 8-4
identity callback handler interface, identity overview, 3-2
management framework, 13-9 JAAS roles (deployment roles), 3-8
identity callback handler, identity management jaas.username.simple property, 6-6
framework, 13-3 JACC--see Java Authorization Contract for Containers
identity management API framework for users and Java 2 Security Model, 2-7
roles--see user and role APIs Java Authentication and Authorization Service
identity management framework (JAAS), 2-12
callback types, 13-10 Java Authorization Contract for Containers (Java
configuration, 13-13 ACC)
enabling an application to use, 13-15 enabling, 5-19
identity callback handler, 13-3 introduction, 5-11
identity callback handler interface, 13-9 specifying Java ACC provider, 5-20
identity token, 13-2 Java Key Store (JKS), 19-1
identity token interface, 13-6 Java single sign-on--see Java SSO
multiple OC4J instances, considerations, 13-16 Java SSO
overview, 13-1 configuration and setup, details, 14-7
packaging implementation classes, 13-12 configuration for 10.1.3.1 patch over
programmatic interfaces, 13-5 10.1.3.0.0, 14-17
properties, 13-13 configuration, summary, 14-6
sample, header-based ID token, 13-17 configuring through Application Server
subject asserter, 13-3 Control, 14-8
subject asserter interface, 13-12 deployment scenarios, 14-5
summary of how to use, 13-16 file-based provider and two OC4J
token asserter, 13-2 instances, 14-15
token asserter interface, 13-8 logout API, 14-17
token collector, 13-2 multiple OC4J instances, 14-16
token collector interface, 13-6
Index-4
overview, 14-1 keystore for ORMIS, 15-23
properties, 14-12 keystore, definition, 15-2
summary of how to use, 14-18 keytool utility, 15-3
troubleshooting, 14-18 wallet, equivalent to keystore, 15-2
java.net.URL framework, 16-3 keytool utility
java.security.manager property, 5-2 example, 15-5
java.security.policy property, 5-2 for keystores, 15-3
javax.net.ssl.keyStore property, 16-5
javax.net.ssl.keyStorePassword property, 16-5
L
javax.net.ssl.keyStoreType property, 16-6
javax.net.ssl.trustStore property, 16-6 LDAP
javax.net.ssl.trustStorePassword property, 16-6 external LDAP providers, 10-1
javax.net.ssl.trustStoreType property, 16-6 LDAP-based provider, 8-1
JAZN (term no longer used), 3-2 LDAP principal, 10-9
jazn element, jazn.xml, D-2 LDAP-based provider
jazn subelement of password-manager element, caching properties, 8-22
system-application.xml, 6-2 connection properties, 8-21
jaznadmin user (OID), 8-8, 8-18 creating users with OID DAS, 8-20
JAZNAdminGroup (OID), 8-8, 8-18 default realm, 6-4
jazn-data element, system-jazn-data.xml, D-10 Oracle Identity Management with Oracle Internet
jazn-data.xml Directory, 3-4
overview, 4-8 Oracle Identity Management, steps to use, 8-5
persistence mode, 4-7 overview of Oracle Identity Management key
supplying for deployment, 7-11 components, 8-2
jazn-loginconfig element, realm management, 8-15
system-jazn-data.xml, 9-21, D-11 settings in OC4J configuration files, 8-20
JAZNPermission class, 5-8 troubleshooting, 8-24
jazn-policy element, system-jazn-data.xml, D-12 user, password, and SSL properties, 8-20
jazn-realm element, system-jazn-data.xml, D-14 LDAPLoginModule, 3-4
JAZNUserManager, 3-3 ldapsearch utility, to retrieve realm names from
jazn-web-app element, orion-application.xml, 17-2 OID, 8-25
jazn.xml libraries
bootstrap, 4-9 importing shared library into application, 6-15
element hierarchy, D-1 loading library as OC4J shared library, 6-14
elements and attributes, reference, D-1 Lightweight Directory Access Protocol--see LDAP
file not found, A-4 listloginmodules option, Admintool, 9-20, C-15
locations, 4-10 listperms option, Admintool, C-15
overview, 4-9 listrealms option, Admintool, C-16
samples, 4-10 listroles option, Admintool, C-16
JCA--see resource adapters listusers option, Admintool, C-16
JMX (MBeans), 4-5 logging, A-5
JNDI login configuration provider, specification, 9-1
connection properties, 8-21 login module element, system-jazn-data.xml, D-15
EJB JNDI security properties, 18-9 login modules
with a custom login module, 9-27 adding and removing in Admintool, 9-20, C-10
JSR-77 support, 4-1 configuration in OC4J configuration files, 9-21
JSR-88 support, 4-1 configuring as security provider after
JSSE deployment, 9-18
supported cipher suites, 16-4 configuring as security provider during
using HTTPClient with JSSE, 16-6 deployment, 9-15
configuring in oc4j-ra.xml (J2CA), 9-24
configuring the custom security provider in
K Application Server Control, 9-15
keys and keystores (SSL) configuring with different applications, 2-13
introduction, 1-5 CoreIDLoginModule (Oracle Access
Java Key Store (JKS), 19-1 Manager), 11-18
javax.net.ssl.keyStore property, 16-5 database login module, 9-5
javax.net.ssl.keyStorePassword property, 16-5 definition, 2-13
javax.net.ssl.keyStoreType property, 16-6 deploying, 9-27
keystore for CSIv2, 19-1 EIS connections (J2CA), using for, 20-16
Index-5
granting RMI permission, 9-20 Server), 15-21
in identity management framework, 13-3, 13-11 option element, system-jazn-data.xml, D-17
introducing custom login modules, usage, 9-12 optional packages, used for login modules, 9-14
jazn-loginconfig configuration element, D-11 options element, system-jazn-data.xml, D-18
LDAPLoginModule, 3-4, 10-6 Oracle Access Manager
listing in Admintool, 9-20, C-15 Access Manager SDK, 11-15
login configuration provider, 3-2 Access SDK, 11-14
login configuration provider, specification, 9-1 action URL, protecting, 11-13
login-module configuration element, D-15 application, protecting, 11-18
login-modules configuration element, D-15 architecture, 11-5
optional packages, deployed as, 9-14 auth-method setting, 11-17
packaging, 9-13 basic authentication, 11-10
RealmLoginModule, 9-4 credential_mapping plug-in, 11-10, 11-11
sample, 9-28 EJB application, use case, 11-28
stacking, 2-14 form-based authentication, 11-8
step by step, 9-24 granting permissions to Oracle Access Manager
troubleshooting, 9-3 principals, 11-21
login modules element, system-jazn-data.xml, D-15 granting RMI permission to Oracle Access
login-config element, web.xml, 17-1 Manager principal, 11-22
LoginContext class, 2-13 login module configuration, 11-18
login-module element, system-jazn-data.xml overview, 11-2
for external LDAP providers, 10-6 plug-ins, overview, 11-6
ls command, Admintool shell, C-9 Policy Manager, introduction, 11-3
Policy Manager, running, 11-6
prerequisites, 11-4
M
resource types, configuration, 11-12
man command, Admintool shell, C-9 resource types, overview, 11-6
MBeans sample use cases for J2EE applications, 11-25
definition, 4-1 sample use cases for Web services, 11-29
MBean browser and administration, 4-5 single sign-on cookie, 11-7
member element, system-jazn-data.xml, D-16 troubleshooting, 11-33
members element, system-jazn-data.xml, D-16 validate_password plug-in, 11-10
method-permission element, ejb-jar.xml, 18-5 Web app using HTTP header variables, use
migration case, 11-26
migrating from principals.xml, 7-16, C-17 Web app using SSO cookie, use case, 11-27
migration tool, migrating from file-based provider Web service with SAML token, use case, 11-32
(to LDAP-based or alternative Web service with username token, use case, 11-29
file-based), 7-13 Web service with X.509 token, use case, 11-31
mk command, Admintool shell, C-8 Oracle COREid Access and Identity--see Oracle
mkdir command, Admintool shell, C-8 Access Manager
Oracle Directory Manager (oidadmin), 4-4
N Oracle Enterprise Manager--see Application Server
Control
name element, system-jazn-data.xml, D-16, D-17 Oracle HTTPS (client-side)
namespace access (EJBs), 18-8 example, JSSE, 16-7
needs-client-auth (SSL client authentication), 15-15 overview, 16-2
system properties, 16-5
O Oracle Identity Management
configuring as security provider after
ObSSOCookie, Oracle Access Manager SSO
deployment, 8-13
cookie, 11-7
configuring as security provider during
oc4jadmin account, 4-12
deployment, 8-12
oc4j-connectors.xml (J2CA), security-permission
default realm, 6-4
element, 20-5
LDAP-based provider (with Oracle Internet
oc4j-ra.xml (J2CA)
Directory), 3-4
login module settings, 9-24
overview, key components, 8-2
security-config element, 20-4
troubleshooting, 8-24
oidadmin (Oracle Directory Manager), 4-4
using, steps to use, 8-5
OID--see Oracle Internet Directory
Oracle Internet Directory
omitting realm names from principals, 6-6
Delegated Administration Services (DAS), 4-4
OPMN (Oracle Process Manager and Notification
Index-6
jaznadmin user, JAZNAdminGroup, 8-8, 8-18 provider), C-13
LDAP-based provider (with Oracle Identity clear (human-readable) (file-based provider), 6-3
Management), 3-4 indirect passwords, 6-1
Oracle Directory Manager (oidadmin), 4-4 obfuscated passwords for LDAP user, 8-21
overview, 8-2 password indirection, 6-1
ports, with or without SSL, 8-6, 8-21 password obfuscation, 6-1, 6-3
realm names, retrieving with ldapsearch, 8-25 setting in Admintool (file-based provider), C-13
supported versions, 8-5 Permission class, subclasses, characteristics, 2-9
Oracle Java SSL (deprecated), 16-13 permission element, system-jazn-data.xml, D-18
Oracle Wallet permissions
auto-login wallet, SSO wallet, 15-12 capability model of access control, 1-2
usage by Oracle HTTP Server, 15-2 granting and revoking in Admintool, C-14
OracleAS JAAS Provider granting EJB permissions in browser, 18-11
introduction, 3-1 in Java 2 Security Model, 2-9
permissions, checking, 5-9 listing in Admintool, C-15
permissions, granting, 5-7 OracleAS JAAS Provider APIs for checking, 5-9
policy APIs, 5-6 OracleAS JAAS Provider APIs for granting, 5-7
policy configuration, 5-14 permissions element, system-jazn-data.xml, D-18
policy management, 5-12 persistence mode, system-jazn-data.xml or
realm APIs, 5-6 jazn-data.xml, 4-7
specifying as login configuration provider, 9-1 plug-ins (Oracle Access Manager)
specifying as policy provider, 5-16 credential_mapping, 11-10, 11-11
OracleAS Single Sign-On overview, 11-6
integration, 3-3 validate_password, 11-10
overview, 8-3 policies
servlet session synchronization, 8-11 definition, JAAS policy, 2-15
supported versions, 8-5 definition, Java 2 policy, 2-10
oracle.home property, 5-4 file-based provider, policy management, 7-2
oracle.j2ee.home property, 4-10 grant configuration element, D-9
oracle.security.jazn.config property, 4-10 granting permissions, Admintool, 5-12
OracleSSLCredential, Oracle Java SSL Java 2 policy file, creating, 5-3
package, 16-14 Java 2 policy file, specifying, 5-1
Oracle.ssl.defaultCipherSuites property (Oracle Java jazn-policy configuration element, D-12
SSL), 16-17 OracleAS JAAS Provider policy APIs, 5-6
orion-application.xml package for policy management, 3-3
configuring SSO, 8-14 policy cache, LDAP, 8-22
jazn and jazn-web-app elements, 4-6 policy configuration, OracleAS JAAS
login module settings, 9-22 Provider, 5-14
mapping J2EE roles to deployment roles, 17-9 policy management, OracleAS JAAS
orion-ejb-jar.xml Provider, 5-12
CSIv2 properties, 19-5 policy provider, 3-2
default security role, 18-8 policy provider, specification, 5-16
security role mapping configuration, 18-7 Policy Manager, Oracle Access Manager
ORMI tunneling over HTTPS, 15-23 introduction, 11-3
ORMIS running, 11-6
configuring access restrictions, 15-21 policy provider, specification, 5-16
configuring clients to use ORMIS, 15-22 ports, for Oracle Internet Directory, with or without
configuring for OC4J in OAS, 15-21 SSL, 8-6, 8-21
configuring for standalone OC4J, 15-19 principal element, system-jazn-data.xml, D-18
principals
in JAAS, definition, 2-12
P
Principal interface, 2-12
packaging sample principal class, 9-33
identity management framework implementation principals element, system-jazn-data.xml, D-19
classes, 13-12 principals.xml
login modules, 9-13 migrating from, in Admintool, C-17
password-manager element, principals.xml, migrating from, in Admintool, 7-16
system-application.xml, 6-2 PrintingSecurityManager, 5-3
passwords property element, jazn.xml, D-4
checking in Admintool (file-based PropertyPermission, 18-11
Index-7
protection domains, 2-9 security contract, 20-1
PUBLIC role (for access by any authenticated resource types (Oracle Access Manager)
user), 6-12 configuration, 11-12
pwd command, Admintool shell, C-9 overview, 11-6
revokeperm option, Admintool, C-14
revokerole option, Admintool, C-14
R
rm command, Admintool shell, C-10
realm element, system-jazn-data.xml, D-19 RMI permission
RealmLoginModule class granting for login modules, 9-20
configuring, 9-4 granting to administrator roles, external LDAP
introduction, 3-3 provider, 10-9
realm-name element, system-jazn-data.xml, D-19 granting to appropriate role for EJB, 18-10
RealmPermission class, 5-8 granting to LDAP principal, 10-9
realms granting to Oracle Access Manager
adding and removing in Admintool, C-11 principal, 11-22
default realm, file-based or LDAP-based role and user APIs
provder, 6-4 model/framework, 12-2
file-based provider, realm management, 7-2 overview, 12-1
hierarchy for OracleAS JAAS Provider, 8-16 properties file, 12-8
jazn-realm configuration element, D-14 replacement of UserManager, User, Group
listing in Admintool, C-16 features, 12-2
managing identity management realms sample, basic, 12-8
(OID), 8-18 sample, OC4J integration, 12-9
managing in file-based provider, 7-11 steps and samples, 12-4
managing in LDAP-based environments, 8-15 summary of classes and interfaces, 12-3
multiple realms, 6-6 role element, system-jazn-data.xml, D-20
nondefault realm, 6-5 RoleAdminPermission class, 5-8
omitting realm name from principals, 6-6 roles
OracleAS JAAS Provider realm APIs, 5-6 adding and removing in Admintool (file-based
overview, 3-3 provider), C-12
package for realm management, 3-3 application roles, 3-8
realm cache, LDAP, 8-22 case-sensitivity, custom login modules, 9-3
realm configuration element, D-19 case-sensitivity, external LDAP providers, 10-2
relation of JAAS Provider realms to OID case-sensitivity, file-based provider, 7-1
realms, 8-17 case-sensitivity, LDAP-based provider, 8-2
retrieving from OID using ldapsearch, 8-25 creating, editing, deleting (file-based
tasks and guidelines in OC4J, 6-3 provider), 7-7
troubleshooting, A-4 definition, 1-3
using multiple identity management realms deployment roles, 3-8
(OID), 8-19 granting and revoking in Admintool, C-14
remloginmodule option, Admintool, 9-20, C-10 J2EE roles, 3-8
remrealm option, Admintool, C-11 listing in Admintool, C-16
remrole option, Admintool, C-12 mapping J2EE roles to deployment roles, 17-9
remuser option, Admintool, C-12 mapping logical roles to users and roles,
resource adapters EJBs, 18-6
authentication in container-managed mapping, overview, 3-8
sign-on, 20-9 methods unchecked for security roles, EJBs, 18-6
component-managed sign-on, 20-6 role configuration element, D-20
component-managed vs. container-managed role-based access control, 1-3
sign-on, 20-2 roles configuration element, D-20
container-managed sign-on, 20-7 roles element, system-jazn-data.xml, D-20
declarative container-managed sign-on, 20-9 run-as element, ejb-jar.xml, 18-6
login modules for EIS connections, 20-16 run-as security identity
overview of security and authentication for EJBs, 18-6
setup, 20-1 for Web applications, 17-8
overview of security-related configuration runas-mode (obsolete setting), 5-6
elements, 20-4 RuntimePermission, 18-11
programmatic container-managed sign-on, 20-12
sample, programmatic container-managed
sign-on, 20-14
Index-8
S SocketPermission, 18-11
SSL
samples
authentication in SSL, 1-4
identity management framework, header-based ID
client authentication, 15-15
token, 13-17
debugging, 15-18
jazn-loginconfig configuration, D-11
enabling SSL in OC4J, 15-5
jazn-policy configuration, D-12
enabling/disabling for LDAP-based
jazn-realm configuration, D-14
provider, 8-20
JSSE with HTTPClient, 16-7
host name verification for HTTPClient, 16-8
login module, 9-28
integration with JAAS provider, 15-2
Oracle Access Manager use cases for J2EE
introduction, 1-4
applications, 11-25
ORMI over SSL, 15-18
Oracle Access Manager use cases for Web
ORMI tunneling over HTTPS, 15-23
services, 11-29
port for Oracle Internet Directory with SSL, 8-6,
programmatic container-managed sign-on
8-21
(resource adapters), 20-14
troubleshooting, 15-17
sample servlet, various features, B-1
truststores, 19-1
Sun Java System Directory Server
using certificates with OC4J and Oracle HTTP
configuration, 10-10
Server, 15-2
user and role APIs, basic example, 12-8
ssl-config element, Web site XML file, 15-7
user and role APIs, OC4J integration, 12-9
SSO--see single sign-on
sas-context element, orion-ejb-jar.xml, 19-6
stacking login modules, 2-14
Secure Sockets Layer--see SSL
subject asserter interface, identity management
security managers
framework, 13-12
overview, 2-11
subject asserter, identity management
PrintingSecurityManager for debug, 5-3
framework, 13-3
specifying, enabling, 5-1
subject propagation
security provider
enabling, 18-14
definition, 1-1
overview in OC4J, 18-13
supported providers, 3-3
removing/configuring restrictions, 18-15
security-identity element, ejb-jar.xml, 18-6
sharing principal classes, 18-15
SecurityManager class, 2-11
Subject.doAs() and Subject.doAsPrivileged()
security-role element, ejb-jar.xml, 18-4
method descriptions, 2-15
security-role-mapping element,
with JAAS mode, 5-5
orion-ejb-jar.xml, 18-7
subjects
security-role-ref element, ejb-jar.xml, 18-3
in JAAS, definition, 2-12
sep-property element, internal-settings.xml, 19-1
Subject class, 2-12
servlet session synchronization (with SSO), 8-11
Sun Java System Directory Server (external LDAP
session cache, LDAP, 8-22
provider, example), 10-10
session synchronization for servlets (with SSO), 8-11
system application
session-tracking element, orion-web.xml, 15-8
overview, 4-10
set command, Admintool shell, C-10
system-application.xml, 4-7
setpasswd option, Admintool, C-13
system-jazn-data.xml
setSSLEnabledCipherSuites() method, Oracle Java
and Admintool, 4-3
SSL, 16-17
element hierarchy, D-4
shared libraries
elements and attributes, reference, D-6
importing, 6-15
for policy data, 7-12
loading, 6-14
overview, 4-7
shared Web applications, 15-8
persistence mode, 4-7
shell commands, Admintool, C-8
settings for login modules, 9-21
shell option, Admintool, C-6
single sign-on
alternatives in Oracle Application Server, 3-6 T
configuring in orion-application.xml, 8-14 third-party LDAP providers--see external LDAP
definition, 3-6 providers
integration with JAAS provider, 8-4 token asserter interface, identity management
Java SSO, 14-1 framework, 13-8
Oracle Access Manager SSO cookie, 11-7 token asserter, identity management
Oracle Access Manager SSO, configure Web framework, 13-2
apps, 11-17 token collector interface, identity management
OracleAS Single Sign-On overview, 8-3
Index-9
framework, 13-6 users configuration element, D-22
token collector, identity management users element, system-jazn-data.xml, D-22
framework, 13-2
transport-config element, orion-ejb-jar.xml, 19-5
V
troubleshooting
EJBs, 18-3 validate_password plug-in, Oracle Access
external LDAP providers, 10-2 Manager, 11-10
general OC4J security troubleshooting, A-3 value element, system-jazn-data.xml, D-22
Java SSO, 14-18
JAZN not properly configured, A-4 W
LDAP-based provider, 8-24
logging, A-5 wallet, equivalent to keystore, 15-2
login modules, 9-3 wallets--see Oracle Wallet
Oracle Access Manager, 11-33 Web services, use cases with Oracle Access
Oracle Identity Management, 8-24 Manager, 11-29
realms, A-4 web-app element, Web site XML file, 15-8
SSL, 15-17 WebGate vs. AccessGate (Oracle Access
unable to locate login configuration, A-4 Manager), 11-3
trust points, 1-4 web.xml
truststores (SSL) configuring authentication method, 17-1
introduction, 1-6 configuring J2EE security roles, 3-8
javax.net.ssl.trustStore property, 16-6
javax.net.ssl.trustStorePassword property, 16-6 X
javax.net.ssl.trustStoreType property, 16-6
XML-based provider--see file-based provider
truststore for CSIv2, 19-1
tunneling, ORMI over HTTPS, 15-23
type element, system-jazn-data.xml, D-20, D-21
U
unchecked element, ejb-jar.xml, 18-6
url element, system-jazn-data.xml, D-21
use-caller-identity element, ejb-jar.xml, 18-6
user and role APIs
model/framework, 12-2
overview, 12-1
properties file, 12-8
replacement of UserManager, User, Group
features, 12-2
sample, basic, 12-8
sample, OC4J integration, 12-9
steps and samples, 12-4
summary of classes and interfaces, 12-3
User class (deprecated), 9-5, 12-2
user element, system-jazn-data.xml, D-21
user repository, 1-1
UserManager class (deprecated), 12-2
users
activating/deactivating (file-based
provider), 4-12
adding and removing in Admintool (file-based
provider), C-12
creating, editing, deleting (file-based
provider), 7-5
creating, with OID DAS for LDAP-based
provider, 8-20
ldap.user and ldap.password properties for
LDAP, 8-20
listing in Admintool, C-16
user configuration element, D-21
Index-10