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
JaasAuthenticator
is 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 newJaasAuthenticator
with the suppliedAuthenticatorConfig
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.naming.directory.Attributes
authenticate(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.Attributes
authenticate(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 newJaasAuthenticator
with 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.NamingException
This 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:
authenticate
in classAuthenticator
- Parameters:
user
-String
username for bindcredential
-Object
credential 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.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 callingDnResolver.resolve(String)
. SeeAbstractAuthenticator.authenticateAndAuthorize(String, Object, boolean, String[], AuthenticationResultHandler[], AuthorizationHandler[])
.- Overrides:
authenticate
in classAuthenticator
- Parameters:
user
-String
username for bindcredential
-Object
credential 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
-
-