fr.paris.lutece.plugins.mylutece.modules.webserver.authentication
Class WebServerAuthentication

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

public class WebServerAuthentication
extends fr.paris.lutece.plugins.mylutece.authentication.ExternalAuthentication

The Class provides an implementation of the PortalService interface based on a WebServer authentication (Ex : Tomcat Realm).

Since:
Lutece v1.1
Version:
1.1
Author:
Mairie de Paris

Constructor Summary
WebServerAuthentication()
          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
 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 WebServer
 boolean isBasedOnHttpAuthentication()
          Indicate that the authentication uses only HttpRequest data to authenticate users (ex : Web Server authentication).
 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 base repository
 void logout(fr.paris.lutece.portal.service.security.LuteceUser user)
          This methods logout the user
 
Methods inherited from class fr.paris.lutece.plugins.mylutece.authentication.ExternalAuthentication
getAccessControledTemplate, getAccessDeniedTemplate, getDoLoginUrl, getDoLogoutUrl, getLoginPageUrl, getLostPasswordPageUrl, getNewAccountPageUrl, getUser, getUsers, getViewAccountPageUrl, isExternalAuthentication, isUsersListAvailable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebServerAuthentication

public WebServerAuthentication()
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
This methods checks the login info in the base repository

Parameters:
strUserName - The username
strUserPassword - The password
request - The HTTP request
Returns:
A LuteceUser object corresponding to the login
Throws:
javax.security.auth.login.LoginException - The LoginException

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

isBasedOnHttpAuthentication

public boolean isBasedOnHttpAuthentication()
Indicate that the authentication uses only HttpRequest data to authenticate users (ex : Web Server authentication).

Returns:
true if the authentication service authenticates users only with the Http Request, otherwise false.

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 WebServer

Parameters:
request - The HTTP request
Returns:
Returns A Lutece User or null if there no user authenticated


Copyright © 2008 Mairie de Paris. All Rights Reserved.