fr.paris.lutece.plugins.mylutece.modules.openiddatabase.authentication
Class BaseAuthentication

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

public class BaseAuthentication
extends fr.paris.lutece.plugins.mylutece.authentication.PortalAuthentication

The Class provides an implementation of the inherited abstract class PortalAuthentication based on a database.

Since:
Lutece v2.0.0
Version:
2.0.0
Author:
Mairie de Paris

Field Summary
static java.lang.String PARAMETER_ERROR
           
static java.lang.String PARAMETER_PAGE
           
static java.lang.String PARAMETER_XPAGE_VALUE
           
 
Constructor Summary
BaseAuthentication()
          Constructor
 
Method Summary
 fr.paris.lutece.portal.service.security.LuteceUser getAnonymousUser()
          This method returns an anonymous Lutece user
 java.lang.String getAuthServiceName()
          Gets the Authentification service name
 java.lang.String getAuthType(javax.servlet.http.HttpServletRequest request)
          Gets the Authentification type
 java.lang.String getChangePasswordPageUrl()
          Returns the Change password page URL of the Authentication Service
 java.lang.String getLostPasswordPageUrl()
          Returns the lost password URL of the Authentication Service
 java.lang.String getNewAccountPageUrl()
          Returns the New account page URL of the Authentication Service
 fr.paris.lutece.portal.service.security.LuteceUser getUser(java.lang.String userLogin)
          Returns the user managed by the authentication service if this feature is available.
 java.util.Collection<fr.paris.lutece.portal.service.security.LuteceUser> getUsers()
          Returns all users managed by the authentication service if this feature is available.
 java.lang.String getViewAccountPageUrl()
          Returns the View account page URL of the Authentication Service
 boolean isUserInRole(fr.paris.lutece.portal.service.security.LuteceUser user, javax.servlet.http.HttpServletRequest request, java.lang.String strRole)
          Checks that the current user is associated to a given role
 fr.paris.lutece.portal.service.security.LuteceUser login(java.lang.String strUserName, java.lang.String strUserPassword, javax.servlet.http.HttpServletRequest request)
          This methods checks the login info in the database
 fr.paris.lutece.portal.service.security.LuteceUser loginDatabase(java.lang.String strUserName, java.lang.String strUserPassword, javax.servlet.http.HttpServletRequest request)
           
 fr.paris.lutece.portal.service.security.LuteceUser loginOpenId(java.lang.String strUserName, javax.servlet.http.HttpServletRequest request)
           
 void logout(fr.paris.lutece.portal.service.security.LuteceUser user)
          This methods logout the user
 java.lang.String verifyResponse(javax.servlet.http.HttpServletRequest request)
          processing the authentication response
 
Methods inherited from class fr.paris.lutece.plugins.mylutece.authentication.PortalAuthentication
getAccessControledTemplate, getAccessDeniedTemplate, getDoLoginUrl, getDoLogoutUrl, getHttpAuthenticatedUser, getLoginPageUrl, getRolesByUser, isExternalAuthentication, isUsersListAvailable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER_PAGE

public static final java.lang.String PARAMETER_PAGE
See Also:
Constant Field Values

PARAMETER_XPAGE_VALUE

public static final java.lang.String PARAMETER_XPAGE_VALUE
See Also:
Constant Field Values

PARAMETER_ERROR

public static final java.lang.String PARAMETER_ERROR
See Also:
Constant Field Values
Constructor Detail

BaseAuthentication

public BaseAuthentication()
Constructor

Method Detail

getAuthServiceName

public java.lang.String getAuthServiceName()
Gets the Authentification service name

Returns:
The name of the authentication service

getAuthType

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

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

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
This methods checks the login info in the database

Parameters:
strUserName - The username
strUserPassword - The password
request - The HttpServletRequest
Returns:
A LuteceUser object corresponding to the login
Throws:
javax.security.auth.login.LoginException - The LoginException
fr.paris.lutece.portal.service.security.LoginRedirectException

loginOpenId

public fr.paris.lutece.portal.service.security.LuteceUser loginOpenId(java.lang.String strUserName,
                                                                      javax.servlet.http.HttpServletRequest request)
                                                               throws javax.security.auth.login.LoginException,
                                                                      fr.paris.lutece.portal.service.security.LoginRedirectException
Throws:
javax.security.auth.login.LoginException
fr.paris.lutece.portal.service.security.LoginRedirectException

loginDatabase

public fr.paris.lutece.portal.service.security.LuteceUser loginDatabase(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
Throws:
javax.security.auth.login.LoginException
fr.paris.lutece.portal.service.security.LoginRedirectException

logout

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

Parameters:
user - The user

getAnonymousUser

public fr.paris.lutece.portal.service.security.LuteceUser getAnonymousUser()
This method returns an anonymous Lutece user

Returns:
An anonymous Lutece user

isUserInRole

public boolean isUserInRole(fr.paris.lutece.portal.service.security.LuteceUser user,
                            javax.servlet.http.HttpServletRequest request,
                            java.lang.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

getViewAccountPageUrl

public java.lang.String getViewAccountPageUrl()
Returns the View account page URL of the Authentication Service

Specified by:
getViewAccountPageUrl in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Overrides:
getViewAccountPageUrl in class fr.paris.lutece.plugins.mylutece.authentication.PortalAuthentication
Returns:
The URL

getNewAccountPageUrl

public java.lang.String getNewAccountPageUrl()
Returns the New account page URL of the Authentication Service

Specified by:
getNewAccountPageUrl in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Overrides:
getNewAccountPageUrl in class fr.paris.lutece.plugins.mylutece.authentication.PortalAuthentication
Returns:
The URL

getChangePasswordPageUrl

public java.lang.String getChangePasswordPageUrl()
Returns the Change password page URL of the Authentication Service

Returns:
The URL

getLostPasswordPageUrl

public java.lang.String getLostPasswordPageUrl()
Returns the lost password URL of the Authentication Service

Specified by:
getLostPasswordPageUrl in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Overrides:
getLostPasswordPageUrl in class fr.paris.lutece.plugins.mylutece.authentication.PortalAuthentication
Returns:
The URL

getUsers

public java.util.Collection<fr.paris.lutece.portal.service.security.LuteceUser> getUsers()
Returns all users managed by the authentication service if this feature is available.

Specified by:
getUsers in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Overrides:
getUsers in class fr.paris.lutece.plugins.mylutece.authentication.PortalAuthentication
Returns:
A collection of Lutece users or null if the service doesn't provide a users list

getUser

public fr.paris.lutece.portal.service.security.LuteceUser getUser(java.lang.String userLogin)
Returns the user managed by the authentication service if this feature is available.

Specified by:
getUser in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Overrides:
getUser in class fr.paris.lutece.plugins.mylutece.authentication.PortalAuthentication
Returns:
A Lutece users or null if the service doesn't provide a user

verifyResponse

public java.lang.String verifyResponse(javax.servlet.http.HttpServletRequest request)
processing the authentication response

Parameters:
request - The HTTP request
Returns:
The URL depending of the result
Throws:
IncompleteUserDetailsException
FirstConnectionException


Copyright © 2010 Mairie de Paris. All Rights Reserved.