com.ibm.security.auth.module

Class Krb5LoginModule

  1. java.lang.Object
  2. extended bycom.ibm.security.auth.module.Krb5LoginModule
All implemented interfaces:
javax.security.auth.spi.LoginModule

  1. public class Krb5LoginModule
  2. extends java.lang.Object
  3. implements javax.security.auth.spi.LoginModule

A JAAS LoginModule for acquiring Kerberos credentials.

Supported options (specified in a JAAS configuration file):

 1) Kerberos options
       principal=principalName
       credsType=initiator|acceptor|both (default=initiator)
       forwardable=true|false (default=false)
       proxiable=true|false (default=false)
       renewable=true|false (default=false)
       useCcache=URL
       useKeytab=URL
       useDefaultCcache=true|false (default=false)
       useDefaultKeytab=true|false (default=false)
       noAddress=true|false (default=false)
  2) JAAS-suggested options:
       debug=true|false (default=unset, JGSS debug options used)
       tryFirstPass=true|false (default=false)
       useFirstPass=true|false (default=false)
       moduleBanner=true|false (default=false)
  NOTES:
 1) Default realm (which is obtained from the Kerberos config file) is
    used if the principal specified does not include a realm component.
 2) debug option: true is equivalent to com.ibm.jgss.debug=all
                  false is equivalent to com.ibm.jgss.debug=off
    The debug option affects debug from the Login module only;
    other subcomponents of JGSS are not affected.
 3) Boolean options can be set to "true" or "yes", "false" or "no"
 4) The keytab and ccache options take precedence over tryFirstPass.
    If a keytab or ccache option is set in addition to tryFirstPass,
    the keytab or ccache is used and the principal saved in the shared state
    if login is succesful. There will be no prompting for password if
    the login fails.
 5) The keytab and ccache options are incompatible with the
    useFirstPass option; specifying useFirstPass in conjunction with
    either a keytab or ccache option will cause an exception to be thrown.
 6) From the Java 1.4 JAAS guide:
 try_first_pass - If true, the first LoginModule in the stack
     saves the password entered, and subsequent LoginModules also
     try to use it. If authentication fails, the LoginModules prompt
     for a new password and retry the authentication.
  use_first_pass - If true, the first LoginModule in the stack
     saves the password entered, and subsequent LoginModules also
     try to use it. LoginModules do not prompt for a new password
     if authentication fails (authentication simply fails).
  moduleBanner - If true, then when invoking the CallbackHandler,
     the LoginModule provides a TextOutputCallback as the first Callback,
     which describes the LoginModule performing the authentication.
  debug - If true, instructs a LoginModule to output debugging information.
 

Author:
Thomas Owusu

Constructor Summary

Constructor and Description
Krb5LoginModule()

Method Summary

Modifier and Type Method and Description
  1. boolean
abort()
DOCUMENT ME!
  1. boolean
commit()
DOCUMENT ME!
  1. void
initialize(javax.security.auth.Subject subject,javax.security.auth.callback.CallbackHandler callbackHandler,java.util.Map sharedState,java.util.Map options)
DOCUMENT ME!
  1. boolean
login()
DOCUMENT ME!
  1. boolean
logout()
Logout the user.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Krb5LoginModule

  1. public Krb5LoginModule()

Method Detail

initialize

  1. public void initialize(javax.security.auth.Subject subject,
  2. javax.security.auth.callback.CallbackHandler callbackHandler,
  3. java.util.Map sharedState,
  4. java.util.Map options)
DOCUMENT ME!
Specified by:
initialize in interface javax.security.auth.spi.LoginModule
Parameters:
subject - DOCUMENT ME!
callbackHandler - DOCUMENT ME!
sharedState - DOCUMENT ME!
options - DOCUMENT ME!

login

  1. public boolean login()
  2. throws javax.security.auth.login.LoginException
DOCUMENT ME!
Specified by:
login in interface javax.security.auth.spi.LoginModule
Returns:
DOCUMENT ME!
Throws:
javax.security.auth.login.LoginException - DOCUMENT ME!

commit

  1. public boolean commit()
  2. throws javax.security.auth.login.LoginException
DOCUMENT ME!
Specified by:
commit in interface javax.security.auth.spi.LoginModule
Returns:
DOCUMENT ME!
Throws:
javax.security.auth.login.LoginException - DOCUMENT ME!

abort

  1. public boolean abort()
  2. throws javax.security.auth.login.LoginException
DOCUMENT ME!
Specified by:
abort in interface javax.security.auth.spi.LoginModule
Returns:
DOCUMENT ME!
Throws:
javax.security.auth.login.LoginException - DOCUMENT ME!

logout

  1. public boolean logout()
  2. throws javax.security.auth.login.LoginException
Logout the user.

This method removes the NTPrincipal that was added by the commit method.

Specified by:
logout in interface javax.security.auth.spi.LoginModule
Returns:
true in all cases since this LoginModule should not be ignored.
Throws:
javax.security.auth.login.LoginException - if the logout fails.