|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.ldap.auth.AbstractAuthenticator<AuthenticatorConfig>
edu.vt.middleware.ldap.auth.Authenticator
public class Authenticator
Authenticator contains functions for authenticating a user
against an LDAP.
| Field Summary |
|---|
| Fields inherited from class edu.vt.middleware.ldap.auth.AbstractAuthenticator |
|---|
config, logger |
| Constructor Summary | |
|---|---|
Authenticator()
Default constructor. |
|
Authenticator(AuthenticatorConfig authConfig)
This will create a new Authenticator with the supplied
AuthenticatorConfig. |
|
| Method Summary | |
|---|---|
boolean |
authenticate()
This will authenticate by binding to the LDAP using parameters given by AuthenticatorConfig.setUser(java.lang.String) and AuthenticatorConfig.setCredential(java.lang.Object). |
Attributes |
authenticate(String[] retAttrs)
This will authenticate by binding to the LDAP using parameters given by AuthenticatorConfig.setUser(java.lang.String) and AuthenticatorConfig.setCredential(java.lang.Object). |
boolean |
authenticate(String user,
Object credential)
This will authenticate by binding to the LDAP with the supplied user and credential. |
boolean |
authenticate(String user,
Object credential,
AuthenticationResultHandler[] authHandler,
AuthorizationHandler[] authzHandler)
This will authenticate by binding to the LDAP with the supplied user and credential. |
boolean |
authenticate(String user,
Object credential,
SearchFilter filter)
This will authenticate by binding to the LDAP with the supplied user and credential. |
Attributes |
authenticate(String user,
Object credential,
SearchFilter filter,
String[] retAttrs)
This will authenticate by binding to the LDAP with the supplied user and credential. |
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. |
AuthenticatorConfig |
getAuthenticatorConfig()
This returns the AuthenticatorConfig of the
Authenticator. |
String |
getDn(String user)
This will attempt to find the LDAP DN for the supplied user. |
void |
loadFromProperties()
This will set the config parameters of this Authenticator
using the default properties file, which must be located in your classpath. |
void |
loadFromProperties(InputStream is)
This will set the config parameters of this Authenticator
using the supplied input stream. |
| 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 |
|---|
public Authenticator()
public Authenticator(AuthenticatorConfig authConfig)
Authenticator with the supplied
AuthenticatorConfig.
authConfig - AuthenticatorConfig| Method Detail |
|---|
public AuthenticatorConfig getAuthenticatorConfig()
AuthenticatorConfig of the
Authenticator.
AuthenticatorConfigpublic void loadFromProperties()
Authenticator
using the default properties file, which must be located in your classpath.
public void loadFromProperties(InputStream is)
Authenticator
using the supplied input stream.
is - InputStream
public String getDn(String user)
throws NamingException
AuthenticatorConfig.dnResolver is invoked to perform this operation.
user - String to find dn for
String - user's dn
NamingException - an LDAP error occurs
public boolean authenticate()
throws NamingException
AuthenticatorConfig.setUser(java.lang.String) and AuthenticatorConfig.setCredential(java.lang.Object). See authenticate(String,
Object).
boolean - whether the bind succeeded
NamingException - if the authentication fails for any other reason
than invalid credentials
public boolean authenticate(String user,
Object credential)
throws NamingException
AuthenticatorConfig.setAuthorizationFilter(java.lang.String) has been
called, then it will be used to authorize the user by performing an ldap
compare. See authenticate(String, Object, SearchFilter).
user - String username for bindcredential - Object credential for bind
boolean - whether the bind succeeded
NamingException - if the authentication fails for any other reason
than invalid credentials
public boolean authenticate(String user,
Object credential,
SearchFilter filter)
throws NamingException
AuthenticatorConfig.setAuthenticationResultHandlers(
AuthenticationResultHandler[]) has been called, then it will be used to
post process authentication results. See authenticate(String,
Object, AuthenticationResultHandler[], AuthorizationHandler[]).
user - String username for bindcredential - Object credential for bindfilter - SearchFilter to authorize user
boolean - whether the bind succeeded
NamingException - if the authentication fails for any other reason
than invalid credentials
public boolean authenticate(String user,
Object credential,
AuthenticationResultHandler[] authHandler,
AuthorizationHandler[] authzHandler)
throws NamingException
DnResolver.resolve(String). See AbstractAuthenticator.authenticateAndAuthorize(String, Object, AuthenticationResultHandler[],
AuthorizationHandler[]).
user - String username for bindcredential - Object credential for bindauthHandler - AuthenticationResultHandler[] to post
process authentication resultsauthzHandler - AuthorizationHandler[] to process
authorization after authentication
boolean - whether the bind succeeded
NamingException - if the authentication fails for any other reason
than invalid credentials
public Attributes authenticate(String[] retAttrs)
throws NamingException
AuthenticatorConfig.setUser(java.lang.String) and AuthenticatorConfig.setCredential(java.lang.Object). See authenticate(String,Object,String[])
retAttrs - String[] attributes to return
Attributes - of authenticated user
NamingException - if any of the ldap operations fail
public Attributes authenticate(String user,
Object credential,
String[] retAttrs)
throws NamingException
AuthenticatorConfig.setAuthorizationFilter(java.lang.String) has been
called, then it will be used to authorize the user by performing an ldap
compare. See authenticate(String, Object, SearchFilter, String[])
user - String username for bindcredential - Object credential for bindretAttrs - String[] to return
Attributes - of authenticated user
NamingException - if any of the ldap operations fail
public Attributes authenticate(String user,
Object credential,
SearchFilter filter,
String[] retAttrs)
throws NamingException
authenticate(String, Object,
String[], AuthenticationResultHandler[], AuthorizationHandler[]).
user - String username for bindcredential - Object credential for bindfilter - SearchFilter to authorize userretAttrs - String[] to return
Attributes - of authenticated user
NamingException - if any of the ldap operations fail
public Attributes authenticate(String user,
Object credential,
String[] retAttrs,
AuthenticationResultHandler[] authHandler,
AuthorizationHandler[] authzHandler)
throws NamingException
DnResolver.resolve(String). See AbstractAuthenticator.authenticateAndAuthorize(String, Object, boolean, String[],
AuthenticationResultHandler[], AuthorizationHandler[]).
user - String username for bindcredential - Object credential for bindretAttrs - String[] to returnauthHandler - AuthenticationResultHandler[] to post
process authentication resultsauthzHandler - AuthorizationHandler[] to process
authorization after authentication
Attributes - of authenticated user
NamingException - if any of the ldap operations fail
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||