org.jboss.security.auth.callback
Class SecurityAssociationHandler

java.lang.Object
  extended byorg.jboss.security.auth.callback.SecurityAssociationHandler
All Implemented Interfaces:
javax.security.auth.callback.CallbackHandler
Direct Known Subclasses:
WebCallbackHandler (src)

public class SecurityAssociationHandler
extends java.lang.Object
implements javax.security.auth.callback.CallbackHandler

An implementation of CallbackHandler is assigned a Principal, and opaque Object credential as values passed to the constructor. This is suitable for environments that need non-interactive JAAS logins and is used by the JaasSecurityManager as its default CallbackHandler.

See Also:
CallbackHandler, handle(Callback[])

Constructor Summary
SecurityAssociationHandler()
           
SecurityAssociationHandler(java.security.Principal principal, java.lang.Object credential)
          Initialize the UsernamePasswordHandler with the principal and credentials to use.
 
Method Summary
 void handle(javax.security.auth.callback.Callback[] callbacks)
          Handles SecurityAssociationCallback, ObjectCallback, NameCallback and PasswordCallback types.
 void setSecurityInfo(java.security.Principal principal, java.lang.Object credential)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityAssociationHandler

public SecurityAssociationHandler()

SecurityAssociationHandler

public SecurityAssociationHandler(java.security.Principal principal,
                                  java.lang.Object credential)
Initialize the UsernamePasswordHandler with the principal and credentials to use.

Method Detail

setSecurityInfo

public void setSecurityInfo(java.security.Principal principal,
                            java.lang.Object credential)

handle

public void handle(javax.security.auth.callback.Callback[] callbacks)
            throws javax.security.auth.callback.UnsupportedCallbackException
Handles SecurityAssociationCallback, ObjectCallback, NameCallback and PasswordCallback types. A NameCallback name property is set to the Prinicpal.getName() value. A PasswordCallback password property is set to the getPassword() value. The preferred SecurityAssociationCallback has its principal and credential properties set to the instance principal and credential. An ObjectCallback has its credential set to the credential value.

Specified by:
handle in interface javax.security.auth.callback.CallbackHandler
Throws:
UnsupportedCallbackException, - thrown if any callback of type other than SecurityAssociationCallback, ObjectCallback, NameCallback or PasswordCallback are seen.
javax.security.auth.callback.UnsupportedCallbackException
See Also:
#getPassword()