Class MultiLuteceAuthentication
- java.lang.Object
-
- fr.paris.lutece.plugins.mylutece.authentication.AbstractAuthentication
-
- fr.paris.lutece.plugins.mylutece.authentication.MultiLuteceAuthentication
-
- All Implemented Interfaces:
ILuteceUserAttributesProvidedDescription,ILuteceUserRolesProvidedDescription,fr.paris.lutece.portal.service.security.LuteceAuthentication
public class MultiLuteceAuthentication extends AbstractAuthentication
Manages serveralMyLuteceAuthentication. CallregisterAuthentication(LuteceAuthentication)to register your authentication andremoveAuthentication(String)to unregister it.
-
-
Constructor Summary
Constructors Constructor Description MultiLuteceAuthentication()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanfindResetPassword(javax.servlet.http.HttpServletRequest request, java.lang.String strLogin)java.lang.StringgetAccessControledTemplate()Returns the access controled templatejava.lang.StringgetAccessDeniedTemplate()Returns the access denied templatefr.paris.lutece.portal.service.security.LuteceUsergetAnonymousUser()java.lang.StringgetAuthServiceName()java.lang.StringgetAuthType(javax.servlet.http.HttpServletRequest request)java.lang.StringgetDoLoginUrl()Returns the DoLogin URL of the Authentication Service.java.lang.StringgetDoLogoutUrl()Returns the disconnect URL of the Authentication Service.fr.paris.lutece.portal.service.security.LuteceUsergetHttpAuthenticatedUser(javax.servlet.http.HttpServletRequest request)Finds the http authenticated user.java.lang.StringgetIconUrl()No icon directlty shown for this authentication.java.util.List<fr.paris.lutece.portal.service.security.LuteceAuthentication>getListLuteceAuthentication()Returns all known security authentication servicesjava.lang.StringgetLoginPageUrl()Returns the Login page URL of the Authentication Service.java.lang.StringgetLostLoginPageUrl()Returns the lost login URL of the Authentication Service.java.lang.StringgetLostPasswordPageUrl()Returns the lost password URL of the Authentication Service.fr.paris.lutece.portal.service.security.LuteceAuthenticationgetLuteceAuthentication(java.lang.String strKey)Gets the authentication by its keyjava.lang.StringgetName()Alwaysnull, not supposed to be identifiablejava.lang.StringgetNewAccountPageUrl()Returns the new account page URL of the Authentication Service
Tries to get authentication specific new account page url form request (passed throughLocalVariables), default otherswise.java.lang.StringgetPluginName()Alwaysnull, this implementation is not plugin related.java.lang.StringgetResetPasswordPageUrl(javax.servlet.http.HttpServletRequest request)java.lang.String[]getRolesByUser(fr.paris.lutece.portal.service.security.LuteceUser user)fr.paris.lutece.portal.service.security.LuteceUsergetUser(java.lang.String strUserLogin)Tries to get user from any authentication.java.util.Collection<fr.paris.lutece.portal.service.security.LuteceUser>getUsers()Gets all known users from all authentications.java.lang.StringgetViewAccountPageUrl()Returns the View account page URL of the Authentication Service
Tries to get authentication specific view account page url form request (passed throughLocalVariables), default otherswise.booleanisDelegatedAuthentication()booleanisExternalAuthentication()booleanisMultiAuthenticationSupported()booleanisUserInRole(fr.paris.lutece.portal.service.security.LuteceUser user, javax.servlet.http.HttpServletRequest request, java.lang.String strRole)booleanisUsersListAvailable()Returns false.fr.paris.lutece.portal.service.security.LuteceUserlogin(java.lang.String strUserName, java.lang.String strUserPassword, javax.servlet.http.HttpServletRequest request)voidlogout(fr.paris.lutece.portal.service.security.LuteceUser user)static voidregisterAuthentication(fr.paris.lutece.portal.service.security.LuteceAuthentication authentication)Registers an authentication.static voidremoveAuthentication(java.lang.String strAuthenticationName)Removes the authentication from managed authenticationvoidupdateDateLastLogin(fr.paris.lutece.portal.service.security.LuteceUser user, javax.servlet.http.HttpServletRequest request)-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface fr.paris.lutece.plugins.mylutece.service.ILuteceUserAttributesProvidedDescription
getLuteceUserAttributesProvided
-
Methods inherited from interface fr.paris.lutece.plugins.mylutece.service.ILuteceUserRolesProvidedDescription
getLuteceUserRolesProvided
-
-
-
-
Method Detail
-
registerAuthentication
public static void registerAuthentication(fr.paris.lutece.portal.service.security.LuteceAuthentication authentication)
Registers an authentication. Should be called at plugin init/install.- Parameters:
authentication- the authentication to register.
-
removeAuthentication
public static void removeAuthentication(java.lang.String strAuthenticationName)
Removes the authentication from managed authentication- Parameters:
strAuthenticationName- the authentication key
-
getLoginPageUrl
public java.lang.String getLoginPageUrl()
Returns the Login page URL of the Authentication Service.
Tries to get authentication specific login page url form request (passed throughLocalVariables), default otherswise.- Returns:
- The URL authentication specific login page url, default otherswise.
-
getDoLoginUrl
public java.lang.String getDoLoginUrl()
Returns the DoLogin URL of the Authentication Service.
Tries to get authentication specific dologin page url form request (passed throughLocalVariables), default otherswise.- Returns:
- The URL
-
getNewAccountPageUrl
public java.lang.String getNewAccountPageUrl()
Returns the new account page URL of the Authentication Service
Tries to get authentication specific new account page url form request (passed throughLocalVariables), default otherswise.- Returns:
- The URL
-
getViewAccountPageUrl
public java.lang.String getViewAccountPageUrl()
Returns the View account page URL of the Authentication Service
Tries to get authentication specific view account page url form request (passed throughLocalVariables), default otherswise.- Returns:
- The URL
-
getLostPasswordPageUrl
public java.lang.String getLostPasswordPageUrl()
Returns the lost password URL of the Authentication Service.
Tries to get authentication specific lost password page url form request (passed throughLocalVariables), default otherswise.- Returns:
- The URL
-
getLostLoginPageUrl
public java.lang.String getLostLoginPageUrl()
Returns the lost login URL of the Authentication Service.
Tries to get authentication specific lost login page url from request (passed throughLocalVariables), default otherwise.- Returns:
- The URL
-
findResetPassword
public boolean findResetPassword(javax.servlet.http.HttpServletRequest request, java.lang.String strLogin)
-
getResetPasswordPageUrl
public java.lang.String getResetPasswordPageUrl(javax.servlet.http.HttpServletRequest request)
-
getDoLogoutUrl
public java.lang.String getDoLogoutUrl()
Returns the disconnect URL of the Authentication Service.
Tries to get authentication specific dologout page url form request (passed throughLocalVariables), default otherswise.- Returns:
- The URL
-
getAccessDeniedTemplate
public java.lang.String getAccessDeniedTemplate()
Returns the access denied template- Returns:
- The template
-
getAccessControledTemplate
public java.lang.String getAccessControledTemplate()
Returns the access controled template- Returns:
- The template
-
getAnonymousUser
public fr.paris.lutece.portal.service.security.LuteceUser getAnonymousUser()
-
getAuthServiceName
public java.lang.String getAuthServiceName()
-
getAuthType
public java.lang.String getAuthType(javax.servlet.http.HttpServletRequest request)
-
getHttpAuthenticatedUser
public fr.paris.lutece.portal.service.security.LuteceUser getHttpAuthenticatedUser(javax.servlet.http.HttpServletRequest request)
Finds the http authenticated user.- Specified by:
getHttpAuthenticatedUserin interfacefr.paris.lutece.portal.service.security.LuteceAuthentication- Overrides:
getHttpAuthenticatedUserin classAbstractAuthentication- Parameters:
request- the reuqest- Returns:
- the first successfully recovered user,
nullotherwise.
-
getRolesByUser
public java.lang.String[] getRolesByUser(fr.paris.lutece.portal.service.security.LuteceUser user)
-
getUser
public fr.paris.lutece.portal.service.security.LuteceUser getUser(java.lang.String strUserLogin)
Tries to get user from any authentication.
Due to huge calculation, this method should not be called often.- Parameters:
strUserLogin- user login- Returns:
- the LuteceUser found,
nullotherwise.
-
getUsers
public java.util.Collection<fr.paris.lutece.portal.service.security.LuteceUser> getUsers()
Gets all known users from all authentications.- Returns:
- all kown users list.
-
isExternalAuthentication
public boolean isExternalAuthentication()
-
isUserInRole
public boolean isUserInRole(fr.paris.lutece.portal.service.security.LuteceUser user, javax.servlet.http.HttpServletRequest request, java.lang.String strRole)- Specified by:
isUserInRolein interfacefr.paris.lutece.portal.service.security.LuteceAuthentication- Overrides:
isUserInRolein classAbstractAuthentication
-
isUsersListAvailable
public boolean isUsersListAvailable()
Returns false. User list should not be directly recovered, due to use CPU usage.- Returns:
- false.
-
login
public fr.paris.lutece.portal.service.security.LuteceUser login(java.lang.String strUserName, java.lang.String strUserPassword, javax.servlet.http.HttpServletRequest request) throws javax.security.auth.login.LoginException, fr.paris.lutece.portal.service.security.LoginRedirectException- Specified by:
loginin interfacefr.paris.lutece.portal.service.security.LuteceAuthentication- Overrides:
loginin classAbstractAuthentication- Throws:
javax.security.auth.login.LoginExceptionfr.paris.lutece.portal.service.security.LoginRedirectException
-
logout
public void logout(fr.paris.lutece.portal.service.security.LuteceUser user)
-
isMultiAuthenticationSupported
public boolean isMultiAuthenticationSupported()
-
getLuteceAuthentication
public fr.paris.lutece.portal.service.security.LuteceAuthentication getLuteceAuthentication(java.lang.String strKey)
Gets the authentication by its key- Parameters:
strKey- the key- Returns:
- the
LuteceAuthenticationfound,nullotherwise.
-
isDelegatedAuthentication
public boolean isDelegatedAuthentication()
-
getListLuteceAuthentication
public java.util.List<fr.paris.lutece.portal.service.security.LuteceAuthentication> getListLuteceAuthentication()
Returns all known security authentication services- Returns:
- all known security authentication services
-
getIconUrl
public java.lang.String getIconUrl()
No icon directlty shown for this authentication.- Returns:
- icon url
-
getName
public java.lang.String getName()
Alwaysnull, not supposed to be identifiable- Returns:
- null
-
getPluginName
public java.lang.String getPluginName()
Alwaysnull, this implementation is not plugin related.- Returns:
- null
-
updateDateLastLogin
public void updateDateLastLogin(fr.paris.lutece.portal.service.security.LuteceUser user, javax.servlet.http.HttpServletRequest request)
-
-