org.springframework.security.authentication.jaas
Class JaasNameCallbackHandler

java.lang.Object
  extended by org.springframework.security.authentication.jaas.JaasNameCallbackHandler
All Implemented Interfaces:
JaasAuthenticationCallbackHandler

public class JaasNameCallbackHandler
extends Object
implements JaasAuthenticationCallbackHandler

The most basic Callbacks to be handled when using a LoginContext from JAAS, are the NameCallback and PasswordCallback. Spring Security provides the JaasNameCallbackHandler specifically tailored to handling the NameCallback.

See Also:
Callback, NameCallback

Constructor Summary
JaasNameCallbackHandler()
           
 
Method Summary
 void handle(Callback callback, Authentication authentication)
          If the callback passed to the 'handle' method is an instance of NameCallback, the JaasNameCallbackHandler will call, callback.setName(authentication.getPrincipal().toString()).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaasNameCallbackHandler

public JaasNameCallbackHandler()
Method Detail

handle

public void handle(Callback callback,
                   Authentication authentication)
            throws IOException,
                   UnsupportedCallbackException
If the callback passed to the 'handle' method is an instance of NameCallback, the JaasNameCallbackHandler will call, callback.setName(authentication.getPrincipal().toString()).

Specified by:
handle in interface JaasAuthenticationCallbackHandler
Parameters:
callback -
authentication -
Throws:
IOException
UnsupportedCallbackException