fr.paris.lutece.plugins.mylutece.authentication
Class MultiLuteceAuthentication

java.lang.Object
  extended by fr.paris.lutece.plugins.mylutece.authentication.MultiLuteceAuthentication
All Implemented Interfaces:
fr.paris.lutece.portal.service.security.LuteceAuthentication

public class MultiLuteceAuthentication
extends Object
implements fr.paris.lutece.portal.service.security.LuteceAuthentication

Manages serveral MyLuteceAuthentication. Call registerAuthentication(LuteceAuthentication) to register your authentication and removeAuthentication(String) to unregister it.


Constructor Summary
MultiLuteceAuthentication()
           
 
Method Summary
 boolean findResetPassword(javax.servlet.http.HttpServletRequest request, String strLogin)
          
 String getAccessControledTemplate()
          Returns the access controled template
 String getAccessDeniedTemplate()
          Returns the access denied template
 fr.paris.lutece.portal.service.security.LuteceUser getAnonymousUser()
          
 String getAuthServiceName()
          
 String getAuthType(javax.servlet.http.HttpServletRequest request)
          
 String getDoLoginUrl()
          Returns the DoLogin URL of the Authentication Service.
 String getDoLogoutUrl()
          Returns the disconnect URL of the Authentication Service.
 fr.paris.lutece.portal.service.security.LuteceUser getHttpAuthenticatedUser(javax.servlet.http.HttpServletRequest request)
          Finds the http authenticated user.
 String getIconUrl()
          No icon directlty shown for this authentication.
 List<fr.paris.lutece.portal.service.security.LuteceAuthentication> getListLuteceAuthentication()
          Returns all known security authentication services
 String getLoginPageUrl()
          Returns the Login page URL of the Authentication Service.
 String getLostLoginPageUrl()
          Returns the lost login URL of the Authentication Service.
 String getLostPasswordPageUrl()
          Returns the lost password URL of the Authentication Service.
 fr.paris.lutece.portal.service.security.LuteceAuthentication getLuteceAuthentication(String strKey)
          Gets the authentication by its key
 String getName()
          Always null, not supposed to be identifiable
 String getNewAccountPageUrl()
          Returns the new account page URL of the Authentication Service
Tries to get authentication specific new account page url form request (passed through LocalVariables ), default otherswise.
 String getPluginName()
          Always null, this implementation is not plugin related.
 String getResetPasswordPageUrl(javax.servlet.http.HttpServletRequest request)
          
 String[] getRolesByUser(fr.paris.lutece.portal.service.security.LuteceUser user)
          
 fr.paris.lutece.portal.service.security.LuteceUser getUser(String strUserLogin)
          Tries to get user from any authentication.
 Collection<fr.paris.lutece.portal.service.security.LuteceUser> getUsers()
          Gets all known users from all authentications.
 String getViewAccountPageUrl()
          Returns the View account page URL of the Authentication Service
Tries to get authentication specific view account page url form request (passed through LocalVariables ), default otherswise.
 boolean isDelegatedAuthentication()
          
 boolean isExternalAuthentication()
          
 boolean isMultiAuthenticationSupported()
          
 boolean isUserInRole(fr.paris.lutece.portal.service.security.LuteceUser user, javax.servlet.http.HttpServletRequest request, String strRole)
          
 boolean isUsersListAvailable()
          Returns false.
 fr.paris.lutece.portal.service.security.LuteceUser login(String strUserName, String strUserPassword, javax.servlet.http.HttpServletRequest request)
          
 void logout(fr.paris.lutece.portal.service.security.LuteceUser user)
          
static void registerAuthentication(fr.paris.lutece.portal.service.security.LuteceAuthentication authentication)
          Registers an authentication.
static void removeAuthentication(String strAuthenticationName)
          Removes the authentication from managed authentication
 void updateDateLastLogin(fr.paris.lutece.portal.service.security.LuteceUser user, javax.servlet.http.HttpServletRequest request)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiLuteceAuthentication

public MultiLuteceAuthentication()
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(String strAuthenticationName)
Removes the authentication from managed authentication

Parameters:
strAuthenticationName - the authentication key

getLoginPageUrl

public String getLoginPageUrl()
Returns the Login page URL of the Authentication Service.
Tries to get authentication specific login page url form request (passed through LocalVariables ), default otherswise.

Specified by:
getLoginPageUrl in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Returns:
The URL authentication specific login page url, default otherswise.

getDoLoginUrl

public String getDoLoginUrl()
Returns the DoLogin URL of the Authentication Service.
Tries to get authentication specific dologin page url form request (passed through LocalVariables ), default otherswise.

Specified by:
getDoLoginUrl in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Returns:
The URL

getNewAccountPageUrl

public String getNewAccountPageUrl()
Returns the new account page URL of the Authentication Service
Tries to get authentication specific new account page url form request (passed through LocalVariables ), default otherswise.

Specified by:
getNewAccountPageUrl in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Returns:
The URL

getViewAccountPageUrl

public String getViewAccountPageUrl()
Returns the View account page URL of the Authentication Service
Tries to get authentication specific view account page url form request (passed through LocalVariables ), default otherswise.

Specified by:
getViewAccountPageUrl in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Returns:
The URL

getLostPasswordPageUrl

public String getLostPasswordPageUrl()
Returns the lost password URL of the Authentication Service.
Tries to get authentication specific lost password page url form request (passed through LocalVariables ), default otherswise.

Specified by:
getLostPasswordPageUrl in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Returns:
The URL

getLostLoginPageUrl

public String getLostLoginPageUrl()
Returns the lost login URL of the Authentication Service.
Tries to get authentication specific lost login page url from request (passed through LocalVariables ), default otherwise.

Specified by:
getLostLoginPageUrl in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Returns:
The URL

findResetPassword

public boolean findResetPassword(javax.servlet.http.HttpServletRequest request,
                                 String strLogin)

Specified by:
findResetPassword in interface fr.paris.lutece.portal.service.security.LuteceAuthentication

getResetPasswordPageUrl

public String getResetPasswordPageUrl(javax.servlet.http.HttpServletRequest request)

Specified by:
getResetPasswordPageUrl in interface fr.paris.lutece.portal.service.security.LuteceAuthentication

getDoLogoutUrl

public String getDoLogoutUrl()
Returns the disconnect URL of the Authentication Service.
Tries to get authentication specific dologout page url form request (passed through LocalVariables ), default otherswise.

Specified by:
getDoLogoutUrl in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Returns:
The URL

getAccessDeniedTemplate

public String getAccessDeniedTemplate()
Returns the access denied template

Specified by:
getAccessDeniedTemplate in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Returns:
The template

getAccessControledTemplate

public String getAccessControledTemplate()
Returns the access controled template

Specified by:
getAccessControledTemplate in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Returns:
The template

getAnonymousUser

public fr.paris.lutece.portal.service.security.LuteceUser getAnonymousUser()

Specified by:
getAnonymousUser in interface fr.paris.lutece.portal.service.security.LuteceAuthentication

getAuthServiceName

public String getAuthServiceName()

Specified by:
getAuthServiceName in interface fr.paris.lutece.portal.service.security.LuteceAuthentication

getAuthType

public String getAuthType(javax.servlet.http.HttpServletRequest request)

Specified by:
getAuthType in interface fr.paris.lutece.portal.service.security.LuteceAuthentication

getHttpAuthenticatedUser

public fr.paris.lutece.portal.service.security.LuteceUser getHttpAuthenticatedUser(javax.servlet.http.HttpServletRequest request)
Finds the http authenticated user.

Specified by:
getHttpAuthenticatedUser in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Parameters:
request - the reuqest
Returns:
the first successfully recovered user, null otherwise.

getRolesByUser

public String[] getRolesByUser(fr.paris.lutece.portal.service.security.LuteceUser user)

Specified by:
getRolesByUser in interface fr.paris.lutece.portal.service.security.LuteceAuthentication

getUser

public fr.paris.lutece.portal.service.security.LuteceUser getUser(String strUserLogin)
Tries to get user from any authentication.
Due to huge calculation, this method should not be called often.

Specified by:
getUser in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Parameters:
strUserLogin - user login
Returns:
the LuteceUser found, null otherwise.

getUsers

public Collection<fr.paris.lutece.portal.service.security.LuteceUser> getUsers()
Gets all known users from all authentications.

Specified by:
getUsers in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Returns:
all kown users list.

isExternalAuthentication

public boolean isExternalAuthentication()

Specified by:
isExternalAuthentication in interface fr.paris.lutece.portal.service.security.LuteceAuthentication

isUserInRole

public boolean isUserInRole(fr.paris.lutece.portal.service.security.LuteceUser user,
                            javax.servlet.http.HttpServletRequest request,
                            String strRole)

Specified by:
isUserInRole in interface fr.paris.lutece.portal.service.security.LuteceAuthentication

isUsersListAvailable

public boolean isUsersListAvailable()
Returns false. User list should not be directly recovered, due to use CPU usage.

Specified by:
isUsersListAvailable in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Returns:
false.

login

public fr.paris.lutece.portal.service.security.LuteceUser login(String strUserName,
                                                                String strUserPassword,
                                                                javax.servlet.http.HttpServletRequest request)
                                                         throws LoginException,
                                                                fr.paris.lutece.portal.service.security.LoginRedirectException

Specified by:
login in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Throws:
LoginException
fr.paris.lutece.portal.service.security.LoginRedirectException

logout

public void logout(fr.paris.lutece.portal.service.security.LuteceUser user)

Specified by:
logout in interface fr.paris.lutece.portal.service.security.LuteceAuthentication

isMultiAuthenticationSupported

public boolean isMultiAuthenticationSupported()

Specified by:
isMultiAuthenticationSupported in interface fr.paris.lutece.portal.service.security.LuteceAuthentication

getLuteceAuthentication

public fr.paris.lutece.portal.service.security.LuteceAuthentication getLuteceAuthentication(String strKey)
Gets the authentication by its key

Parameters:
strKey - the key
Returns:
the LuteceAuthentication found, null otherwise.

isDelegatedAuthentication

public boolean isDelegatedAuthentication()

Specified by:
isDelegatedAuthentication in interface fr.paris.lutece.portal.service.security.LuteceAuthentication

getListLuteceAuthentication

public List<fr.paris.lutece.portal.service.security.LuteceAuthentication> getListLuteceAuthentication()
Returns all known security authentication services

Returns:
all known security authentication services

getIconUrl

public String getIconUrl()
No icon directlty shown for this authentication.

Specified by:
getIconUrl in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Returns:
icon url

getName

public String getName()
Always null, not supposed to be identifiable

Specified by:
getName in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Returns:
null

getPluginName

public String getPluginName()
Always null, this implementation is not plugin related.

Specified by:
getPluginName in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Returns:
null

updateDateLastLogin

public void updateDateLastLogin(fr.paris.lutece.portal.service.security.LuteceUser user,
                                javax.servlet.http.HttpServletRequest request)

Specified by:
updateDateLastLogin in interface fr.paris.lutece.portal.service.security.LuteceAuthentication


Copyright © 2014 Mairie de Paris. All Rights Reserved.