|
WebLogic Server 6.1 Code Examples, BEA Systems, Inc. | |||||
See:
Description
| Interface Summary | |
| Frobable | A remote interface that illustrates access control on an RMI object. |
| Class Summary | |
| CertLoginModule | Sample login module for certificate based mutual authentication. |
| ConfigParser | |
| FrobImpl | Illustrates how to use an ACL to protect the methods of an RMI object's. |
| MyCallbackHandler | Implementation of the CallbackHandler Interface |
| SampleAction | |
| SampleClient | Sample client for JAAS user authentication |
| SampleConfig | Sample configuration class for JAAS user authentication. |
| SampleLoginModule | Sample login module that performs password authentication. |
This package demonstrates how to access a WebLogic Server resource (in this case, an RMI object) through the use of JAAS authentication. JAAS authentication replaces a JNDI Environment object as the way to pass authentication data from a client to WebLogic Server. Two JAAS login modules are supplied in the package:
Perform the following steps in order to build, compile and run the example:
ant
javac -d %SERVER_CLASSES% Frobable.java FrobImpl.java
java weblogic.rmic -d %SERVER_CLASSES% examples.security.acl.FrobImpl
javac -d %CLIENT_CLASSES% SampleAction.java
javac -d %CLIENT_CLASSES% SampleClient.java
javac -d %CLIENT_CLASSES% SampleConfig.java
javac -d %CLIENT_CLASSES% SampleLoginModule.java
javac -d %CLIENT_CLASSES% CertLoginModule.java
javac -d %CLIENT_CLASSES% ConfigParser.java
Note: The Examples WebLogic Server comes pre-configured with users and groups; the preceding procedure is provided mostly for informational purposes.
You can also use digital certificate and private key you obtain with the JAAS code example. Copy the digital certificates and the private key file into the directory in which you are running the JAAS code example.
-Djava.security.auth.policy=%WL_HOME%\config\examples\Sample.policy
java -Dweblogic.security.SSL.ignoreHostnameVerification=true examples.security.jaas.SampleClient url
url specifies the T3 or HTTP protocol and the default port on which WebLogic Server listens for communications. SampleClient does support access using the HTTPS protocol.
For example:
java -Dweblogic.security.SSL.ignoreHostnameVerification=true examples.security.jaas.SampleClient t3://localhost:7001
java -Dweblogic.security.SSL.ignoreHostnameVerification=true examples.security.jaas.SampleClient url cert
cert tells the SampleClient to use the configured CertLoginModule.
For example:
java -Dweblogic.security.SSL.ignoreHostnameVerification=true examples.security.jaas.SampleClient t3s://localhost:7002 cert
You are prompted for the name of the digital certificate for the private key for WebLogic Server, and the name of the digital certificate for the certificate authority. If you use your own digital certificate and its private key is encrypted, enter the password for the private key.
Read more about using the JAAS API to authenticate clients in Programming WebLogic Security .
|
Documentation is available at http://e-docs.bea.com/wls/docs61 |
|||||