edu.vt.middleware.ldap.jaas
Class JaasAuthenticator

java.lang.Object
  extended by edu.vt.middleware.ldap.auth.AbstractAuthenticator<AuthenticatorConfig>
      extended by edu.vt.middleware.ldap.auth.Authenticator
          extended by edu.vt.middleware.ldap.jaas.JaasAuthenticator
All Implemented Interfaces:
Serializable

public class JaasAuthenticator
extends Authenticator

JaasAuthenticator is the default implementation for JAAS authentication.

Version:
$Revision: 1330 $ $Date: 2010-05-23 18:10:53 -0400 (Sun, 23 May 2010) $
Author:
Middleware Services
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.vt.middleware.ldap.auth.AbstractAuthenticator
config, logger
 
Constructor Summary
JaasAuthenticator()
          Default constructor.
JaasAuthenticator(AuthenticatorConfig authConfig)
          This will create a new JaasAuthenticator with the supplied AuthenticatorConfig.
 
Method Summary
 Attributes authenticate(String user, Object credential, String[] retAttrs)
          This will authenticate by binding to the LDAP with the supplied user and credential.
 Attributes authenticate(String user, Object credential, String[] retAttrs, AuthenticationResultHandler[] authHandler, AuthorizationHandler[] authzHandler)
          This will authenticate by binding to the LDAP with the supplied user and credential.
 
Methods inherited from class edu.vt.middleware.ldap.auth.Authenticator
authenticate, authenticate, authenticate, authenticate, authenticate, authenticate, getAuthenticatorConfig, getDn, loadFromProperties, loadFromProperties
 
Methods inherited from class edu.vt.middleware.ldap.auth.AbstractAuthenticator
authenticateAndAuthorize, authenticateAndAuthorize, close, setAuthenticatorConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaasAuthenticator

public JaasAuthenticator()
Default constructor.


JaasAuthenticator

public JaasAuthenticator(AuthenticatorConfig authConfig)
This will create a new JaasAuthenticator with the supplied AuthenticatorConfig.

Parameters:
authConfig - AuthenticatorConfig
Method Detail

authenticate

public Attributes authenticate(String user,
                               Object credential,
                               String[] retAttrs)
                        throws NamingException
This will authenticate by binding to the LDAP with the supplied user and credential. If AuthenticatorConfig.setAuthorizationFilter(java.lang.String) has been called, then it will be used to authorize the user by performing an ldap compare. See Authenticator.authenticate(String, Object, SearchFilter, String[])

Overrides:
authenticate in class Authenticator
Parameters:
user - String username for bind
credential - Object credential for bind
retAttrs - String[] to return
Returns:
Attributes - of authenticated user
Throws:
NamingException - if any of the ldap operations fail

authenticate

public Attributes authenticate(String user,
                               Object credential,
                               String[] retAttrs,
                               AuthenticationResultHandler[] authHandler,
                               AuthorizationHandler[] authzHandler)
                        throws NamingException
This will authenticate by binding to the LDAP with the supplied user and credential. The user's DN will be looked up before performing the bind by calling DnResolver.resolve(String). See AbstractAuthenticator.authenticateAndAuthorize(String, Object, boolean, String[], AuthenticationResultHandler[], AuthorizationHandler[]).

Overrides:
authenticate in class Authenticator
Parameters:
user - String username for bind
credential - Object credential for bind
retAttrs - String[] to return
authHandler - AuthenticationResultHandler[] to post process authentication results
authzHandler - AuthorizationHandler[] to process authorization after authentication
Returns:
Attributes - of authenticated user
Throws:
NamingException - if any of the ldap operations fail


Copyright © 2003-2010 Virginia Tech. All Rights Reserved.