Application Clients: Using SSL Security

To enable one-way authentication using digital certificates with application clients, the only change to be made in the application involves the initial context properties. The following hash table specifies that the login requires both SSL and certificate-based authentication of the WebLogic server:

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
env.put(WLContext.PROVIDER_URL,"t3s://weblogic:7443");
env.put(WLContext.SECURITY_AUTHENTICATION "simple");
env.put(Context.SECURITY_PRINCIPAL, "myusername");
env.put(Context.SECURITY_CREDENTIALS, "mypassword");
ctx = new InitialContext(env);

Note that only one field differs from the standard ...

Get J2EE™ Applications and BEA™ WebLogic Server™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.