fr.paris.lutece.portal.service.security
Interface LuteceAuthentication


public interface LuteceAuthentication

This Interface defines all methods required by an authentication service password is not valid


Method Summary
 boolean findResetPassword(javax.servlet.http.HttpServletRequest request, String strLogin)
          Checks if a user's password has been reset
 String getAccessControledTemplate()
          Returns the template that contains the Access Controled message.
 String getAccessDeniedTemplate()
          Returns the template that contains the Access Denied message.
 LuteceUser getAnonymousUser()
          This method creates an anonymous user
 String getAuthServiceName()
          Gets the Authentification service name
 String getAuthType(javax.servlet.http.HttpServletRequest request)
          Gets the Authentification type
 String getDoLoginUrl()
          Returns the DoLogin URL of the Authentication Service
 String getDoLogoutUrl()
          Returns the DoLogout URL of the Authentication Service
 LuteceUser getHttpAuthenticatedUser(javax.servlet.http.HttpServletRequest request)
          Returns a Lutece user object if the user is already authenticated in the Http request.
 String getIconUrl()
          Icon url
 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
 String getName()
          Used as Identifier.
 String getNewAccountPageUrl()
          Returns the new account page URL of the Authentication Service
 String getPluginName()
          Returns the plugin name.
 String getResetPasswordPageUrl(javax.servlet.http.HttpServletRequest request)
          Returns the reset password URL of the Authentication Service
 String[] getRolesByUser(LuteceUser user)
          get all roles for this user : - user's roles - user's groups roles
 LuteceUser getUser(String strUserLogin)
          Returns user managed by the authentication service if this feature is available.
 Collection<LuteceUser> getUsers()
          Returns all users managed by the authentication service if this feature is available.
 String getViewAccountPageUrl()
          Returns the view account page URL of the Authentication Service
 boolean isDelegatedAuthentication()
          Authentication is done by remote system (like OAuth)
 boolean isExternalAuthentication()
          Indicates that the user should be already authenticated by an external authentication service (ex : Web Server authentication).
 boolean isMultiAuthenticationSupported()
          true when the service provides multi authentication support
 boolean isUserInRole(LuteceUser user, javax.servlet.http.HttpServletRequest request, String strRole)
          Checks that the current user is associated to a given role
 boolean isUsersListAvailable()
          Tells whether or not the authentication service can provide a list of all its users
 LuteceUser login(String strUserName, String strUserPassword, javax.servlet.http.HttpServletRequest request)
          Checks the login
 void logout(LuteceUser user)
          logout the user
 void updateDateLastLogin(LuteceUser user, javax.servlet.http.HttpServletRequest request)
          Update the last login date of a user
 

Method Detail

getAuthServiceName

String getAuthServiceName()
Gets the Authentification service name

Returns:
The Service Name

getAuthType

String getAuthType(javax.servlet.http.HttpServletRequest request)
Gets the Authentification type

Parameters:
request - The HTTP request
Returns:
The type of authentication

login

LuteceUser login(String strUserName,
                 String strUserPassword,
                 javax.servlet.http.HttpServletRequest request)
                 throws LoginException,
                        LoginRedirectException
Checks the login

Parameters:
strUserName - The username
strUserPassword - The user's password
request - The HttpServletRequest
Returns:
The login
Throws:
LoginException - If a Login error occured
LoginRedirectException - If the the login process should be redirected

logout

void logout(LuteceUser user)
logout the user

Parameters:
user - The user

findResetPassword

boolean findResetPassword(javax.servlet.http.HttpServletRequest request,
                          String strLogin)
Checks if a user's password has been reset

Parameters:
request - The request
strLogin - the login
Returns:
True if the password has been reset, false otherwise

getAnonymousUser

LuteceUser getAnonymousUser()
This method creates an anonymous user

Returns:
A LuteceUser object corresponding to an anonymous user

isUserInRole

boolean isUserInRole(LuteceUser user,
                     javax.servlet.http.HttpServletRequest request,
                     String strRole)
Checks that the current user is associated to a given role

Parameters:
user - The user
request - The HTTP request
strRole - The role name
Returns:
Returns true if the user is associated to the role, otherwise false

getRolesByUser

String[] getRolesByUser(LuteceUser user)
get all roles for this user : - user's roles - user's groups roles

Parameters:
user - The user
Returns:
Array of roles

isExternalAuthentication

boolean isExternalAuthentication()
Indicates that the user should be already authenticated by an external authentication service (ex : Web Server authentication).

Returns:
true if the authentication is external, false if the authentication is provided by the Lutece portal.

isDelegatedAuthentication

boolean isDelegatedAuthentication()
Authentication is done by remote system (like OAuth)

Returns:
true if part of the authentication if done by external website, false otherwise.

getHttpAuthenticatedUser

LuteceUser getHttpAuthenticatedUser(javax.servlet.http.HttpServletRequest request)
Returns a Lutece user object if the user is already authenticated in the Http request. This method should return null if the user is not authenticated or if the authentication service is not based on Http authentication.

Parameters:
request - The HTTP request
Returns:
Returns A Lutece User

getLoginPageUrl

String getLoginPageUrl()
Returns the Login page URL of the Authentication Service

Returns:
The URL

getDoLoginUrl

String getDoLoginUrl()
Returns the DoLogin URL of the Authentication Service

Returns:
The URL

getDoLogoutUrl

String getDoLogoutUrl()
Returns the DoLogout URL of the Authentication Service

Returns:
The URL

getNewAccountPageUrl

String getNewAccountPageUrl()
Returns the new account page URL of the Authentication Service

Returns:
The URL

getViewAccountPageUrl

String getViewAccountPageUrl()
Returns the view account page URL of the Authentication Service

Returns:
The URL

getLostPasswordPageUrl

String getLostPasswordPageUrl()
Returns the lost password URL of the Authentication Service

Returns:
The URL

getLostLoginPageUrl

String getLostLoginPageUrl()
Returns the lost login URL of the Authentication Service

Returns:
The URL

getResetPasswordPageUrl

String getResetPasswordPageUrl(javax.servlet.http.HttpServletRequest request)
Returns the reset password URL of the Authentication Service

Parameters:
request - the HTTP request
Returns:
The URL

getAccessDeniedTemplate

String getAccessDeniedTemplate()
Returns the template that contains the Access Denied message.

Returns:
The template path

getAccessControledTemplate

String getAccessControledTemplate()
Returns the template that contains the Access Controled message.

Returns:
The template path

isUsersListAvailable

boolean isUsersListAvailable()
Tells whether or not the authentication service can provide a list of all its users

Returns:
true if the service can return a users list

getUsers

Collection<LuteceUser> getUsers()
Returns all users managed by the authentication service if this feature is available.

Returns:
A collection of Lutece users or null if the service doesn't provide a users list

getUser

LuteceUser getUser(String strUserLogin)
Returns user managed by the authentication service if this feature is available.

Parameters:
strUserLogin - the user login
Returns:
A Lutece user or null if the service doesn't provide LuteceUser

isMultiAuthenticationSupported

boolean isMultiAuthenticationSupported()
true when the service provides multi authentication support

Returns:
true if multi authentication is supported, false otherwise.

getIconUrl

String getIconUrl()
Icon url

Returns:
icon url

getName

String getName()
Used as Identifier. MUST be unique.

Returns:
the identifier

getPluginName

String getPluginName()
Returns the plugin name.
Used to show (or not) this authentication depending on the plugin status .

Returns:
the plugin name

updateDateLastLogin

void updateDateLastLogin(LuteceUser user,
                         javax.servlet.http.HttpServletRequest request)
Update the last login date of a user

Parameters:
user - User to update
request - The request


Copyright © 2014 Mairie de Paris. All Rights Reserved.