Class SecurityManagerService

    • Field Detail

      • PERMANENT_LOCKOUT

        public static final Integer PERMANENT_LOCKOUT
        Provides the 'permanent lockout' property value.
    • Constructor Detail

      • SecurityManagerService

        public SecurityManagerService​(SecurityManager securityManager,
                                      Portal portal)
        Create a Security Manager Service with the given security manager configuration entity and portal.
        Parameters:
        securityManager - the security manager configuration entity
        portal - the associated portal
    • Method Detail

      • createAuthenticationProvider

        public org.springframework.security.authentication.AuthenticationProvider createAuthenticationProvider​(AuthenticationProvider providerEntity)
        Create an Spring Security AuthenticationProvider instance using the associated Portal and AuthenticationProvider configuration entity.
        Specified by:
        createAuthenticationProvider in interface ISecurityManagerService
        Parameters:
        providerEntity - the AuthenticationProvider configuration entity
        Returns:
        a Spring Security AuthenticationProvider
        See Also:
        ISecurityManagerService#createAuthenticationProvider(org.springframework.security.authentication.AuthenticationProvider)
      • createUserAndProfile

        public UserAccount createUserAndProfile​(String loginName,
                                                String email,
                                                String password,
                                                String givenName,
                                                String familyName,
                                                String mobile,
                                                Map<String,​String> profileMap,
                                                String authenticationDomain,
                                                String userType,
                                                boolean isSelfRegistration)
                                         throws ApplicationException
        Create a new user account and profile
        Specified by:
        createUserAndProfile in interface ISecurityManagerService
        Parameters:
        loginName - the user id (required)
        email - the user email address (optional)
        password - the user password (required for Local userType accounts)
        givenName - the user first name (optional)
        familyName - the user last name (optional)
        mobile - the user mobile phone number (optional)
        profileMap - the map of user profile names and values to create
        authenticationDomain - the authentication domain (not used since 4.2.1)
        userType - the type of user account (required)
        isSelfRegistration - the flag specifying whether the user self registered
        Returns:
        the new user account
        Throws:
        ApplicationException - if an error occur creating the new user account
        See Also:
        ISecurityManagerService#createUserAndProfile(String, String, String, String, String, String, String, String, Portal, boolean)
      • doesPasswordMatch

        public boolean doesPasswordMatch​(String password,
                                         UserAccount userAccount)
        Return true if the plain text password value matches the local user account password.
        Specified by:
        doesPasswordMatch in interface ISecurityManagerService
        Parameters:
        password - plain text password value (required)
        userAccount - the local user account, must a 'Local' user type (required)
        Returns:
        true if the plain text password value matches the local user account password
      • onSuccessfulLogin

        public UserAccount onSuccessfulLogin​(String userId,
                                             HttpServletRequest request)
        Event listener for successful user login event. This method will update the status of the user account and return the update account.
        Specified by:
        onSuccessfulLogin in interface ISecurityManagerService
        Parameters:
        userId - the login userId (login name).
        request - the user HTTP request
        Returns:
        the logged in user account
      • onFailedLogin

        public UserAccount onFailedLogin​(String userId,
                                         HttpServletRequest request)
        Event listener for unsuccessful user login event. This method will update the status of the user account and return the updated account
        Specified by:
        onFailedLogin in interface ISecurityManagerService
        Parameters:
        userId - the login userId (login name).
        request - the user HTTP request
        Returns:
        the failed login user account, or null if no user found