Class Oauth2Authentication

  • All Implemented Interfaces:
    fr.paris.lutece.plugins.mylutece.service.ILuteceUserAttributesProvidedDescription, fr.paris.lutece.plugins.mylutece.service.ILuteceUserRolesProvidedDescription, fr.paris.lutece.portal.service.security.LuteceAuthentication, java.io.Serializable

    public class Oauth2Authentication
    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 OpenID
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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 Openam
      java.lang.String getIconUrl()
      java.util.List<fr.paris.lutece.plugins.mylutece.business.LuteceUserAttributeDescription> getLuteceUserAttributesProvided​(java.util.Locale locale)
      java.lang.String getName()
      java.lang.String getPluginName()
      boolean isMultiAuthenticationSupported()
      void logout​(fr.paris.lutece.portal.service.security.LuteceUser user)
      This methods logout the user
      fr.paris.lutece.portal.service.security.LuteceUser processLogin​(java.lang.String strUserName, java.lang.String strUserPassword, javax.servlet.http.HttpServletRequest request)
      This methods checks the login info in the LDAP repository
      • Methods inherited from class fr.paris.lutece.plugins.mylutece.authentication.PortalAuthentication

        findResetPassword, getAccessControledTemplate, getAccessDeniedTemplate, getDoLoginUrl, getDoLogoutUrl, getLoginPageUrl, getLostLoginPageUrl, getLostPasswordPageUrl, getNewAccountPageUrl, getResetPasswordPageUrl, getRolesByUser, getUser, getUsers, getViewAccountPageUrl, isDelegatedAuthentication, isExternalAuthentication, isUsersListAvailable, toString, updateDateLastLogin
      • Methods inherited from class fr.paris.lutece.plugins.mylutece.authentication.AbstractAuthentication

        isUserInRole, login
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface fr.paris.lutece.plugins.mylutece.service.ILuteceUserRolesProvidedDescription

        getLuteceUserRolesProvided
    • Constructor Detail

      • Oauth2Authentication

        public Oauth2Authentication()
    • Method Detail

      • getAuthServiceName

        public java.lang.String getAuthServiceName()
        Gets the Authentification 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 Authentification type
        Specified by:
        getAuthType in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
        Parameters:
        request - The HTTP request
        Returns:
        The type of authentication
      • processLogin

        public fr.paris.lutece.portal.service.security.LuteceUser processLogin​(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 LDAP repository
        Parameters:
        strUserName - The username
        strUserPassword - The password
        request - The HttpServletRequest
        Returns:
        A LuteceUser object corresponding to the login
        Throws:
        fr.paris.lutece.portal.service.security.LoginRedirectException - This exception is used to redirect the authentication to the provider
        javax.security.auth.login.LoginException - The LoginException
      • 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
      • 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
      • getIconUrl

        public java.lang.String getIconUrl()
        Specified by:
        getIconUrl in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
        Overrides:
        getIconUrl in class fr.paris.lutece.plugins.mylutece.authentication.PortalAuthentication
      • 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
      • isMultiAuthenticationSupported

        public boolean isMultiAuthenticationSupported()
        Specified by:
        isMultiAuthenticationSupported in interface fr.paris.lutece.portal.service.security.LuteceAuthentication
        Overrides:
        isMultiAuthenticationSupported in class fr.paris.lutece.plugins.mylutece.authentication.PortalAuthentication
      • 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 Openam
        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 or null if there no user authenticated
      • getLuteceUserAttributesProvided

        public java.util.List<fr.paris.lutece.plugins.mylutece.business.LuteceUserAttributeDescription> getLuteceUserAttributesProvided​(java.util.Locale locale)
        Specified by:
        getLuteceUserAttributesProvided in interface fr.paris.lutece.plugins.mylutece.service.ILuteceUserAttributesProvidedDescription