Establishing Security Through the InitialContext

Some naming service providers like LDAP might require a username and password for a client to connect to it and look up objects within the namespace. The manner in which you can do this is by setting the environment properties for an InitialContext.

Three primary environment properties are defined in the Context interface and help establish the level of security you want to use when interacting with JNDI. The three security-related environment properties are

  • java.naming.security.authentication

  • java.naming.security.principal

  • java.naming.security.credentials

The first property defines the level of security that you will use when creating the InitialContext. There are three basic types of security ...

Get Special Edition Using Enterprise JavaBeans™ 2.0 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.