org.jboss.security.jndi
Class LoginInitialContextFactory

java.lang.Object
  extended byorg.jnp.interfaces.NamingContextFactory (src) 
      extended byorg.jboss.security.jndi.LoginInitialContextFactory
All Implemented Interfaces:
javax.naming.spi.InitialContextFactory, javax.naming.spi.ObjectFactory

public class LoginInitialContextFactory
extends NamingContextFactory (src)

A naming provider InitialContextFactory implementation that combines the authentication phase with the InitialContext creation. During the getInitialContext callback from the JNDI naming layer a JAAS LoginContext is created using the login configuration name passed in as the Context.SECURITY_PROTOCOL env property. The CallbackHandler used is a org.jboss.security.auth.callback.UsernamePasswordHandler that is populated with the username obtained from the Context.SECURITY_PRINCIPAL env property and the credentials from the Context.SECURITY_CREDENTIALS env property.

See Also:
InitialContextFactory

Constructor Summary
LoginInitialContextFactory()
           
 
Method Summary
 javax.naming.Context getInitialContext(java.util.Hashtable env)
          Create new initial context by invoking the NamingContextFactory version of this method after performing a JAAS login.
 
Methods inherited from class org.jnp.interfaces.NamingContextFactory (src)
getObjectInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginInitialContextFactory

public LoginInitialContextFactory()
Method Detail

getInitialContext

public javax.naming.Context getInitialContext(java.util.Hashtable env)
                                       throws javax.naming.NamingException
Create new initial context by invoking the NamingContextFactory version of this method after performing a JAAS login.

Specified by:
getInitialContext in interface javax.naming.spi.InitialContextFactory
Overrides:
getInitialContext in class NamingContextFactory (src)
Throws:
javax.naming.NamingException