Package edu.ucsb.nceas.metacat
Class AuthSession
java.lang.Object
edu.ucsb.nceas.metacat.AuthSession
A Class that implements session tracking for MetaCatServlet users.
User's login data are stored in the session object.
User authentication is done through a dynamically determined AuthInterface.
-
Constructor Summary
ConstructorDescriptionConstruct an AuthSessionAuthSession
(int groupCacheSize) Constructor with cached group information for users. -
Method Summary
Modifier and TypeMethodDescriptionboolean
authenticate
(javax.servlet.http.HttpServletRequest request, String username, String password) determine if the credentials for this session are valid by authenticating them using the authService configured for this session.getAttributes
(String foruser) Get attributes describing a user or groupString[]
Get the all groups in which the given userDN isGet the message associated with authenticating this session.getPrincipals
(String user, String password) Get all groups and users from authentication scheme.javax.servlet.http.HttpSession
Get the new session
-
Constructor Details
-
AuthSession
Construct an AuthSession -
AuthSession
public AuthSession(int groupCacheSize) throws InstantiationException, IllegalAccessException, ClassNotFoundException Constructor with cached group information for users.- Parameters:
groupCacheSize
- the size of the LRUMap map- Throws:
InstantiationException
IllegalAccessException
ClassNotFoundException
-
-
Method Details
-
getSessions
public javax.servlet.http.HttpSession getSessions()Get the new session -
authenticate
public boolean authenticate(javax.servlet.http.HttpServletRequest request, String username, String password) determine if the credentials for this session are valid by authenticating them using the authService configured for this session.- Parameters:
request
- the request made from the clientusername
- the username entered when loginpassword
- the password entered when login
-
getMessage
Get the message associated with authenticating this session. The message is formatted in XML. -
getPrincipals
Get all groups and users from authentication scheme. The output is formatted in XML.- Parameters:
user
- the user which requests the informationpassword
- the user's password- Throws:
ConnectException
-
getAttributes
Get attributes describing a user or group- Parameters:
foruser
- the user for which the attribute list is requested- Throws:
ConnectException
-
getGroups
public String[] getGroups(String logInUserName, String logInUserPassword, String userDN) throws Exception Get the all groups in which the given userDN is- Parameters:
logInUserName
- it can be nulllogInUserPassword
- it can be nulluserDN
-- Returns:
- null if no groups were found for the userDN
- Throws:
Exception
-