Package edu.vt.middleware.ldap.jaas
Class JaasAuthenticator
- java.lang.Object
-
- edu.vt.middleware.ldap.auth.AbstractAuthenticator<AuthenticatorConfig>
-
- edu.vt.middleware.ldap.auth.Authenticator
-
- edu.vt.middleware.ldap.jaas.JaasAuthenticator
-
- All Implemented Interfaces:
java.io.Serializable
public class JaasAuthenticator extends Authenticator
JaasAuthenticatoris the default implementation for JAAS authentication.- Version:
- $Revision: 1330 $ $Date: 2010-05-24 00:10:53 +0200 (Mon, 24 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
Constructors Constructor Description JaasAuthenticator()Default constructor.JaasAuthenticator(AuthenticatorConfig authConfig)This will create a newJaasAuthenticatorwith the suppliedAuthenticatorConfig.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.naming.directory.Attributesauthenticate(java.lang.String user, java.lang.Object credential, java.lang.String[] retAttrs)This will authenticate by binding to the LDAP with the supplied user and credential.javax.naming.directory.Attributesauthenticate(java.lang.String user, java.lang.Object credential, java.lang.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
-
-
-
-
Constructor Detail
-
JaasAuthenticator
public JaasAuthenticator()
Default constructor.
-
JaasAuthenticator
public JaasAuthenticator(AuthenticatorConfig authConfig)
This will create a newJaasAuthenticatorwith the suppliedAuthenticatorConfig.- Parameters:
authConfig-AuthenticatorConfig
-
-
Method Detail
-
authenticate
public javax.naming.directory.Attributes authenticate(java.lang.String user, java.lang.Object credential, java.lang.String[] retAttrs) throws javax.naming.NamingExceptionThis will authenticate by binding to the LDAP with the supplied user and credential. IfAuthenticatorConfig.setAuthorizationFilter(java.lang.String)has been called, then it will be used to authorize the user by performing an ldap compare. SeeAuthenticator.authenticate(String, Object, SearchFilter, String[])- Overrides:
authenticatein classAuthenticator- Parameters:
user-Stringusername for bindcredential-Objectcredential for bindretAttrs-String[]to return- Returns:
Attributes- of authenticated user- Throws:
javax.naming.NamingException- if any of the ldap operations fail
-
authenticate
public javax.naming.directory.Attributes authenticate(java.lang.String user, java.lang.Object credential, java.lang.String[] retAttrs, AuthenticationResultHandler[] authHandler, AuthorizationHandler[] authzHandler) throws javax.naming.NamingExceptionThis 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 callingDnResolver.resolve(String). SeeAbstractAuthenticator.authenticateAndAuthorize(String, Object, boolean, String[], AuthenticationResultHandler[], AuthorizationHandler[]).- Overrides:
authenticatein classAuthenticator- Parameters:
user-Stringusername for bindcredential-Objectcredential for bindretAttrs-String[]to returnauthHandler-AuthenticationResultHandler[]to post process authentication resultsauthzHandler-AuthorizationHandler[]to process authorization after authentication- Returns:
Attributes- of authenticated user- Throws:
javax.naming.NamingException- if any of the ldap operations fail
-
-