Interface SecurityApi

    • Method Detail

      • login

        void login​(Object principal,
                   Object credentials)
        Perform a login attempt.
        Parameters:
        principal - account identity (e.g. username)
        credentials - account credentials (e.g. password)
      • logout

        void logout()
        Log out the current user and invalidate and/or remove any associated entities (e.g. session).
      • isSubjectAuthenticated

        boolean isSubjectAuthenticated()
        Returns:
        true if the subscjet is authenticated
      • getCurrentUserPermissions

        Set<String> getCurrentUserPermissions​(TenantContext context)
        Return the set of permissions for the currently logged-in user.
        Parameters:
        context - tenant context
        Returns:
        the set of permissions for the current user
      • addUserRoles

        void addUserRoles​(String username,
                          String clearPassword,
                          List<String> roles,
                          CallContext context)
                   throws SecurityApiException
        Add a user with roles in the Shiro store (JDBCRealm)
        Parameters:
        username - the username
        clearPassword - the password (in clear)
        roles - the list of (existing) roles
        context - context (does not include tenant nor account info)
        Throws:
        SecurityApiException
      • updateUserPassword

        void updateUserPassword​(String username,
                                String clearPassword,
                                CallContext context)
                         throws SecurityApiException
        Update password for the user
        Parameters:
        username - the username
        clearPassword - the password (in clear)
        context - context (does not include tenant nor account info)
        Throws:
        SecurityApiException
      • updateUserRoles

        void updateUserRoles​(String username,
                             List<String> roles,
                             CallContext context)
                      throws SecurityApiException
        Update the roles associated with the user (only the specified roles will be in effect)
        Parameters:
        username - the username
        roles - the new roles
        context - context (does not include tenant nor account info)
        Throws:
        SecurityApiException
      • getRoleDefinition

        List<String> getRoleDefinition​(String role,
                                       TenantContext tenantContext)
        Retrieves the list of permissions associated to that role in the Shiro store (JDBCRealm)
        Parameters:
        role - the role name
        tenantContext - dummy context
        Returns: