Class AdminAuthenticationService
java.lang.Object
fr.paris.lutece.portal.service.admin.AdminAuthenticationService
This class provides a security service to register and check user authentication
-
Method Summary
Modifier and TypeMethodDescriptionReturns the modification password page URL of the Authentication ServiceReturns the DoLogin URL of the Authentication ServiceReturns the DoLogout URL of the Authentication Servicestatic AdminAuthenticationServiceGet the unique instance of the Security ServicegetLoginNextUrl(jakarta.servlet.http.HttpServletRequest request) Returns the url (asked before login) to redirect after loginReturns the Login page URL of the Authentication ServiceReturns the lost login URL of the Authentication ServiceReturns the lost password URL of the Authentication ServiceReturns the new account page URL of the Authentication ServicegetRegisteredUser(jakarta.servlet.http.HttpServletRequest request) Gets the Lutece user registered in the Http sessiongetRemoteUser(jakarta.servlet.http.HttpServletRequest request) Gets the AdminUser attached to the current Http sessiongetUserListFromModule(String strLastName, String strFirstName, String strEmail) Returns the user listgetUserPublicDataFromModule(String strAccessCode) Returns the view account page URL of the Authentication Servicestatic voidinit()Initialize servicebooleanCheck whether the authentication service is configurer on the default module.booleanReturns the authentication type : External or Lutece portal basedvoidloginUser(jakarta.servlet.http.HttpServletRequest request, String strAccessCode, String strPassword) Checks user's login with the Authentication service.voidlogoutUser(jakarta.servlet.http.HttpServletRequest request) Logout the user<T extends AdminUser>
voidregisterUser(jakarta.servlet.http.HttpServletRequest request, T user) Register the user in the Http sessionvoidsetLoginNextUrl(jakarta.servlet.http.HttpServletRequest request) Set the admin login next urlvoidunregisterUser(jakarta.servlet.http.HttpServletRequest request) Unregister the user in the Http session
-
Method Details
-
init
public static void init()Initialize service -
getInstance
Get the unique instance of the Security Service- Returns:
- The instance
-
isDefaultModuleUsed
public boolean isDefaultModuleUsed()Check whether the authentication service is configurer on the default module.- Returns:
- true if the default module is in use, false if another module is used
-
getRemoteUser
public AdminUser getRemoteUser(jakarta.servlet.http.HttpServletRequest request) throws UserNotSignedException, AccessDeniedException Gets the AdminUser attached to the current Http session- Parameters:
request- The Http request- Returns:
- A valid AdminUser object if found
- Throws:
AccessDeniedException- If the user cannot have accessUserNotSignedException- If the user is not signed
-
loginUser
public void loginUser(jakarta.servlet.http.HttpServletRequest request, String strAccessCode, String strPassword) throws LoginException Checks user's login with the Authentication service.- Parameters:
request- The Http requeststrAccessCode- The user's loginstrPassword- The user's password- Throws:
LoginException- The LoginException
-
logoutUser
public void logoutUser(jakarta.servlet.http.HttpServletRequest request) Logout the user- Parameters:
request- The HTTP request
-
registerUser
public <T extends AdminUser> void registerUser(jakarta.servlet.http.HttpServletRequest request, T user) throws AccessDeniedException, UserNotSignedException Register the user in the Http session- Parameters:
request- The Http requestuser- The current user- Throws:
AccessDeniedException- If the user cannot have accessUserNotSignedException- If the user is not signed
-
unregisterUser
public void unregisterUser(jakarta.servlet.http.HttpServletRequest request) Unregister the user in the Http session- Parameters:
request- The Http request
-
getRegisteredUser
Gets the Lutece user registered in the Http session- Parameters:
request- The HTTP request- Returns:
- The User registered or null if the user has not been registered
-
isExternalAuthentication
public boolean isExternalAuthentication()Returns the authentication type : External or Lutece portal based- Returns:
- true if the user is already authenticated or false if it needs to login.
-
getLoginPageUrl
Returns the Login page URL of the Authentication Service- Returns:
- The URL
-
getChangePasswordPageUrl
Returns the modification password page URL of the Authentication Service- Returns:
- The URL
-
getDoLoginUrl
Returns the DoLogin URL of the Authentication Service- Returns:
- The URL
-
getDoLogoutUrl
Returns the DoLogout URL of the Authentication Service- Returns:
- The URL
-
getNewAccountPageUrl
Returns the new account page URL of the Authentication Service- Returns:
- The URL
-
getViewAccountPageUrl
Returns the view account page URL of the Authentication Service- Returns:
- The URL
-
getLostPasswordPageUrl
Returns the lost password URL of the Authentication Service- Returns:
- The URL
-
getLostLoginPageUrl
Returns the lost login URL of the Authentication Service- Returns:
- The URL
-
getUserListFromModule
public Collection<AdminUser> getUserListFromModule(String strLastName, String strFirstName, String strEmail) Returns the user list- Parameters:
strLastName- The last namestrFirstName- The first namestrEmail- The email- Returns:
- the collection of all users from the module
-
getUserPublicDataFromModule
- Parameters:
strAccessCode- The login- Returns:
- The AdminUser
-
setLoginNextUrl
public void setLoginNextUrl(jakarta.servlet.http.HttpServletRequest request) Set the admin login next url- Parameters:
request- the HTTP request
-
getLoginNextUrl
Returns the url (asked before login) to redirect after login- Parameters:
request- The Http request- Returns:
- The url asked before login
-
getAuthServiceName
- Returns:
- the name of the authentication module load
-