public class AuthLdap extends java.lang.Object implements AuthInterface
GROUPDESINDEX, GROUPNAMEINDEX, USERCNINDEX, USERDNINDEX, USEREMAILINDEX, USERINFOCNINDEX, USERINFOEMAILINDEX, USERINFOORGANIDEX, USERORGINDEX, USERORGUNITINDEX
Constructor and Description |
---|
AuthLdap()
Construct an AuthLdap
|
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(java.lang.String user,
java.lang.String password)
Determine if a user/password are valid according to the authentication
service.
|
java.util.HashMap<java.lang.String,java.util.Vector<java.lang.String>> |
getAttributes(java.lang.String foruser)
Get attributes describing a user or group
|
java.util.HashMap<java.lang.String,java.util.Vector<java.lang.String>> |
getAttributes(java.lang.String user,
java.lang.String password,
java.lang.String foruser)
Get attributes describing a user or group
|
java.lang.String[][] |
getGroups(java.lang.String user,
java.lang.String password)
Get all groups from the authentication service
|
java.lang.String[][] |
getGroups(java.lang.String user,
java.lang.String password,
java.lang.String foruser)
Get the groups for a particular user from the authentication service
|
java.lang.String |
getPrincipals(java.lang.String user,
java.lang.String password)
Get all groups and users from authentication scheme.
|
java.lang.String[] |
getUserInfo(java.lang.String user,
java.lang.String password)
Get all users from the authentication service
|
java.lang.String[][] |
getUsers(java.lang.String user,
java.lang.String password)
Get all users from the authentication service
|
java.lang.String[] |
getUsers(java.lang.String user,
java.lang.String password,
java.lang.String group)
Get the users for a particular group from the authentication service
|
static void |
main(java.lang.String[] args)
Test method for the class
|
static int |
searchUser(java.lang.String user,
java.lang.String[][] userGroup)
Method for getting index of user DN in User info array
|
void |
testCredentials(java.lang.String dn,
java.lang.String password,
java.lang.String rootServer,
java.lang.String rootBase) |
public AuthLdap() throws java.lang.InstantiationException
java.lang.InstantiationException
public boolean authenticate(java.lang.String user, java.lang.String password) throws java.net.ConnectException
authenticate
in interface AuthInterface
user
- the name of the principal to authenticatepassword
- the password to use for authenticationjava.net.ConnectException
public java.lang.String[][] getUsers(java.lang.String user, java.lang.String password) throws java.net.ConnectException
getUsers
in interface AuthInterface
user
- the user for authenticating against the servicepassword
- the password for authenticating against the servicejava.net.ConnectException
public java.lang.String[] getUserInfo(java.lang.String user, java.lang.String password) throws java.net.ConnectException
getUserInfo
in interface AuthInterface
user
- the user for authenticating against the servicepassword
- the password for authenticating against the servicejava.net.ConnectException
public java.lang.String[] getUsers(java.lang.String user, java.lang.String password, java.lang.String group) throws java.net.ConnectException
getUsers
in interface AuthInterface
user
- the user for authenticating against the servicepassword
- the password for authenticating against the servicegroup
- the group whose user list should be returnedjava.net.ConnectException
public java.lang.String[][] getGroups(java.lang.String user, java.lang.String password) throws java.net.ConnectException
getGroups
in interface AuthInterface
user
- the user for authenticating against the servicepassword
- the password for authenticating against the servicejava.net.ConnectException
public java.lang.String[][] getGroups(java.lang.String user, java.lang.String password, java.lang.String foruser) throws java.net.ConnectException
getGroups
in interface AuthInterface
user
- the user for authenticating against the servicepassword
- the password for authenticating against the serviceforuser
- the user whose group list should be returnedjava.net.ConnectException
public java.util.HashMap<java.lang.String,java.util.Vector<java.lang.String>> getAttributes(java.lang.String foruser) throws java.net.ConnectException
getAttributes
in interface AuthInterface
foruser
- the user for which the attribute list is requestedjava.net.ConnectException
public java.util.HashMap<java.lang.String,java.util.Vector<java.lang.String>> getAttributes(java.lang.String user, java.lang.String password, java.lang.String foruser) throws java.net.ConnectException
getAttributes
in interface AuthInterface
user
- the user for authenticating against the servicepassword
- the password for authenticating against the serviceforuser
- the user whose attributes should be returnedjava.net.ConnectException
public java.lang.String getPrincipals(java.lang.String user, java.lang.String password) throws java.net.ConnectException
getPrincipals
in interface AuthInterface
user
- the user which requests the informationpassword
- the user's passwordjava.net.ConnectException
public static int searchUser(java.lang.String user, java.lang.String[][] userGroup)
public void testCredentials(java.lang.String dn, java.lang.String password, java.lang.String rootServer, java.lang.String rootBase) throws javax.naming.NamingException
javax.naming.NamingException
public static void main(java.lang.String[] args)
Copyright © 2020 Regents of the University of California. All Rights Reserved.