fr.paris.lutece.plugins.mylutece.modules.cas.authentication
Class CASAuthentication

java.lang.Object
  extended by fr.paris.lutece.plugins.mylutece.authentication.PortalAuthentication
      extended by fr.paris.lutece.plugins.mylutece.modules.cas.authentication.CASAuthentication
All Implemented Interfaces:
fr.paris.lutece.portal.service.security.LuteceAuthentication, java.io.Serializable

public class CASAuthentication
extends fr.paris.lutece.plugins.mylutece.authentication.PortalAuthentication
implements java.io.Serializable

The class provides an implementation of the inherited abstract class PortalAuthentication based on CAS

See Also:
Serialized Form

Field Summary
static java.lang.String CONSTANT_LUTECE_USER_PROPERTIES_PATH
          Constants
static java.lang.String PROPERTY_BACK_URL_ERROR
           
static java.lang.String PROPERTY_MESSAGE_ERROR_LOGIN
           
static java.lang.String PROPERTY_URL_ERROR_LOGIN_PAGE
           
static java.lang.String PROPERTY_USER_MAPPING_ATTRIBUTES
          Lutece User Attributs
 
Constructor Summary
CASAuthentication()
          Constructor
 
Method Summary
 fr.paris.lutece.portal.service.security.LuteceUser getAnonymousUser()
          This method returns an anonymous Lutece user
 java.lang.String getAuthServiceName()
          Gets the Authentication service name
 java.lang.String getAuthType(javax.servlet.http.HttpServletRequest request)
          Gets the Authentication type
 ICASUserKeyService getCASUserKeyService()
           
 fr.paris.lutece.portal.service.security.LuteceUser getHttpAuthenticatedUser(javax.servlet.http.HttpServletRequest request)
          Returns a Lutece user object if the user is already authenticated by the WSSO
 java.lang.String getName()
          
 java.lang.String getPluginName()
          
 java.lang.String[] getRolesByUser(fr.paris.lutece.portal.service.security.LuteceUser user)
           
 boolean isExternalAuthentication()
          Returns true
 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)
           
 void logout(fr.paris.lutece.portal.service.security.LuteceUser user)
          This methods logout the user
 void setCASUserKeyService(ICASUserKeyService cASUserKeyService)
           
 
Methods inherited from class fr.paris.lutece.plugins.mylutece.authentication.PortalAuthentication
findResetPassword, getAccessControledTemplate, getAccessDeniedTemplate, getDoLoginUrl, getDoLogoutUrl, getIconUrl, getLoginPageUrl, getLostPasswordPageUrl, getNewAccountPageUrl, getResetPasswordPageUrl, getUser, getUsers, getViewAccountPageUrl, isDelegatedAuthentication, isMultiAuthenticationSupported, isUsersListAvailable, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTY_USER_MAPPING_ATTRIBUTES

public static final java.lang.String PROPERTY_USER_MAPPING_ATTRIBUTES
Lutece User Attributs

See Also:
Constant Field Values

PROPERTY_URL_ERROR_LOGIN_PAGE

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

PROPERTY_BACK_URL_ERROR

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

PROPERTY_MESSAGE_ERROR_LOGIN

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

CONSTANT_LUTECE_USER_PROPERTIES_PATH

public static final java.lang.String CONSTANT_LUTECE_USER_PROPERTIES_PATH
Constants

See Also:
Constant Field Values
Constructor Detail

CASAuthentication

public CASAuthentication()
Constructor

Method Detail

getAuthServiceName

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

Specified by:
getAuthServiceName in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Returns:
The name of the authentication service

getAuthType

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

Specified by:
getAuthType in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
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
Specified by:
login in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Throws:
javax.security.auth.login.LoginException
fr.paris.lutece.portal.service.security.LoginRedirectException

getHttpAuthenticatedUser

public fr.paris.lutece.portal.service.security.LuteceUser getHttpAuthenticatedUser(javax.servlet.http.HttpServletRequest request)
Returns a Lutece user object if the user is already authenticated by the WSSO

Specified by:
getHttpAuthenticatedUser in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Overrides:
getHttpAuthenticatedUser in class fr.paris.lutece.plugins.mylutece.authentication.PortalAuthentication
Parameters:
request - The HTTP request
Returns:
Returns A Lutece User

logout

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

Specified by:
logout in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Parameters:
user - The user

getRolesByUser

public java.lang.String[] getRolesByUser(fr.paris.lutece.portal.service.security.LuteceUser user)
Specified by:
getRolesByUser in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
Overrides:
getRolesByUser in class fr.paris.lutece.plugins.mylutece.authentication.PortalAuthentication

getAnonymousUser

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

Specified by:
getAnonymousUser in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
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

Specified by:
isUserInRole in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
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

isExternalAuthentication

public boolean isExternalAuthentication()
Returns true

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

getName

public java.lang.String getName()

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

getPluginName

public java.lang.String getPluginName()

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

getCASUserKeyService

public ICASUserKeyService getCASUserKeyService()

setCASUserKeyService

public void setCASUserKeyService(ICASUserKeyService cASUserKeyService)


Copyright © 2012 Mairie de Paris. All Rights Reserved.