public class LdapAuthProvider extends Object implements AuthRepository
| Modifier and Type | Field and Description |
|---|---|
protected static String[] |
non_sasl_mechs |
protected static String[] |
sasl_mechs |
static String |
USER_DN_PATTERN_KEY
Example:
uid=%s,ou=people,dc=xmpp-test,dc=org |
DATA_KEY, DIGEST_ID_KEY, DIGEST_KEY, MACHANISM_KEY, PASSWORD_KEY, PROTOCOL_KEY, PROTOCOL_VAL_NONSASL, PROTOCOL_VAL_SASL, REALM_KEY, RESULT_KEY, SERVER_NAME_KEY, USER_ID_KEY, USERNAME_KEY| Constructor and Description |
|---|
LdapAuthProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
addUser(tigase.xmpp.BareJID user,
String password)
Describe
addUser method here. |
boolean |
digestAuth(tigase.xmpp.BareJID user,
String digest,
String id,
String alg)
Deprecated.
|
String |
getResourceUri()
getResourceUri method returns database connection string. |
long |
getUsersCount()
This method is only used by the server statistics component to report
number of registered users.
|
long |
getUsersCount(String domain)
This method is only used by the server statistics component to report
number of registered users for given domain.
|
void |
initRepository(String resource_uri,
Map<String,String> params)
initRepository method is doing initialization for database
connection. |
void |
logout(tigase.xmpp.BareJID user)
Describe
logout method here. |
boolean |
otherAuth(Map<String,Object> props)
Describe
otherAuth method here. |
boolean |
plainAuth(tigase.xmpp.BareJID user,
String password)
Deprecated.
|
void |
queryAuth(Map<String,Object> authProps)
queryAuth returns mechanisms available for authentication. |
void |
removeUser(tigase.xmpp.BareJID user)
Describe
removeUser method here. |
void |
updatePassword(tigase.xmpp.BareJID user,
String password)
Describe
updatePassword method here. |
protected static final String[] non_sasl_mechs
protected static final String[] sasl_mechs
public static final String USER_DN_PATTERN_KEY
uid=%s,ou=people,dc=xmpp-test,dc=orgpublic void addUser(tigase.xmpp.BareJID user,
String password)
throws UserExistsException,
TigaseDBException
AuthRepositoryaddUser method here.addUser in interface AuthRepositoryuser - a BareJID valuepassword - a String valueUserExistsException - if an error occursTigaseDBException - if an error occurs@Deprecated public boolean digestAuth(tigase.xmpp.BareJID user, String digest, String id, String alg) throws UserNotFoundException, TigaseDBException, AuthorizationException
AuthRepositorydigestAuth method performs non-sasl, digest authentication
as described in non-sasl authentication
XEP-0078
For now it is empty and always returns false as I don't
have description for database with passwords.digestAuth in interface AuthRepositoryuser - a BareJID value of user namedigest - a String value password digest sumid - a String value session ID used for digest sum
calculation.alg - a String value of algorithm ID used for digest sum
calculation.boolean value true on successful
authentication, false on authentication failure.UserNotFoundException - if an given user name is not found in
the authentication repository.TigaseDBException - if an error occurs during during accessing
database;AuthorizationException - if an error occurs during authentication
process.public String getResourceUri()
AuthRepositorygetResourceUri method returns database connection string.getResourceUri in interface AuthRepositoryString value of database connection string.public long getUsersCount()
AuthRepositorygetUsersCount in interface AuthRepositorylong number of registered users in the repository.public long getUsersCount(String domain)
AuthRepositorygetUsersCount in interface AuthRepositorylong number of registered users in the repository.public void initRepository(String resource_uri, Map<String,String> params) throws DBInitException
AuthRepositoryinitRepository method is doing initialization for database
connection. It may also do lazy initialization with database.
Connection to database might be established during the first authentication
request.initRepository in interface AuthRepositoryresource_uri - a String value of database connection string.
The string must also contain database user name and password if required
for connection.DBInitException - if an error occurs during access database. It won't
happen however as in this method we do simple variable assigment.public void logout(tigase.xmpp.BareJID user)
throws UserNotFoundException,
TigaseDBException
AuthRepositorylogout method here.logout in interface AuthRepositoryuser - a BareJID valueUserNotFoundException - if an error occursTigaseDBException - if an error occurspublic boolean otherAuth(Map<String,Object> props) throws UserNotFoundException, TigaseDBException, AuthorizationException
AuthRepositoryotherAuth method here.otherAuth in interface AuthRepositoryprops - a Map valueboolean valueUserNotFoundException - if an error occursTigaseDBException - if an error occursAuthorizationException - if an error occurs@Deprecated public boolean plainAuth(tigase.xmpp.BareJID user, String password) throws UserNotFoundException, TigaseDBException, AuthorizationException
AuthRepositoryplainAuth method performs non-sasl, plain authentication
as described in non-sasl authentication
XEP-0078.plainAuth in interface AuthRepositoryuser - a BareJID value of user namepassword - a String value of plain user password.boolean value true on successful
authentication, false on authentication failure.UserNotFoundException - if an given user name is not found in
the authentication repository.TigaseDBException - if an error occurs during during accessing
database;AuthorizationException - if an error occurs during authentication
process.public void queryAuth(Map<String,Object> authProps)
AuthRepositoryqueryAuth returns mechanisms available for authentication.queryAuth in interface AuthRepositoryauthProps - a Map value with parameters for authentication.public void removeUser(tigase.xmpp.BareJID user)
throws UserNotFoundException,
TigaseDBException
AuthRepositoryremoveUser method here.removeUser in interface AuthRepositoryuser - a BareJID valueUserNotFoundException - if an error occursTigaseDBException - if an error occurspublic void updatePassword(tigase.xmpp.BareJID user,
String password)
throws UserNotFoundException,
TigaseDBException
AuthRepositoryupdatePassword method here.updatePassword in interface AuthRepositoryuser - a BareJID valuepassword - a String valueUserNotFoundExceptionTigaseDBException - if an error occursCopyright © 2014 "Tigase, Inc.". All rights reserved.