Kernel::System::CustomerUser::OIDC

NAME

Kernel::System::CustomerUser::OIDC – CustomerUser backend for OIDC

MethodParamValidationSchema()

Default parameter validation schema.

CustomerSearch()

to search users

    # text search
    my %List = $CustomerUserObject->CustomerSearch(
        Search => 'some',   # wildcard not supported. IMPORTANT: behaves as a prefix search
        Valid  => 1,        # (optional) default 1
        Limit  => 100,      # (optional) overrides limit of the config
    );

    # username search
    my %List = $CustomerUserObject->CustomerSearch(
        UserLogin => 'some',    # IMPORTANT: Searches within the user login
        Valid     => 1,         # (optional) default 1
    );

    # email search
    my %List = $CustomerUserObject->CustomerSearch(
        PostMasterSearch => 'email@example.com',  # IMPORTANT: Searches within the user email
        Valid            => 1,                    # (optional) default 1
    );

    # search by CustomerID
    my %List = $CustomerUserObject->CustomerSearch(
        CustomerID       => 'CustomerID123',  # search similar
        CustomerIDRaw    => 'CustomerID123',  # search for exact match
        Valid            => 1,                # (optional) default 1
    );

    # search by Agent<->Customer Group.
    my %List = $CustomerUserObject->CustomerSearch(
        UserID       => 7,      # Any search result might be filtered based on
                                #   User <-Group-> CustomerID
        Valid        => 1,      # (optional) default 1
    );

Returns:

    %List = (
        "jsmith" => "John Smith <john.smith@email.com>",
        "lsmith" => "Lincold Smith <lincoln.smith@email.com>",
        ...
    );

CustomerSearchDetail()

To find customer user in the system.

The search criteria are logically AND connected. When a list is passed as criteria, the individual members are OR connected. When an undef or a reference to an empty array is passed, then the search criteria is ignored.

Returns either a list, as an arrayref, or a count of found customer user ids. The count of results is returned when the parameter Result = 'COUNT' is passed.

    my $CustomerUserIDsRef = $CustomerUserObject->CustomerSearchDetail(
        # Check CustomerUserSearchFields() in Kernel::System::CustomerUser.
        SearchFields => [                                               # (required)
            {
                "DatabaseField" => "title",
                "Label" => "Title or salutation",
                "Name" => "UserTitle",
                "Readonly" => 1,
                "Required" => 0,
                "StorageType" => "var",
                "Type" => "Input",
            },
            {
                "DatabaseField" => "enabled",
                "Label" => "Valid",
                "Name" => "ValidID",
                "Readonly" => 0,
                "Required" => 1,
                "SelectionsData" => {
                    "1" => "valid",
                    "2" => "invalid",
                    "3" => "invalid-temporarily",
                },
                "StorageType" => "int",
                "Type" => "Selection",
            },
            ...
        ],

        # all search fields possible which are defined in CustomerUserSearchFields
        UserLogin     => 'example*',                                    # (optional)
        UserFirstname => 'Firstn*',                                     # (optional)

        # special parameters
        CustomerCompanySearchCustomerIDs => [ 'example.com' ],          # (optional)
        ExcludeUserLogins                => [ 'example', 'doejohn' ],   # (optional)

        # array parameters are used with logical OR operator (all values are possible which
        # are defined in the config selection hash for the field)
        UserCountry              => [ 'Austria', 'Germany', ],          # (optional)

        # DynamicFields
        #   At least one operator must be specified. Operators will be connected with AND,
        #       values in an operator with OR.
        #   You can also pass more than one argument to an operator: ['value1', 'value2']
        DynamicField_FieldNameX => {
            Equals            => 123,
            Like              => 'value*',                # "equals" operator with wildcard support
            GreaterThan       => '2001-01-01 01:01:01',
            GreaterThanEquals => '2001-01-01 01:01:01',
            SmallerThan       => '2002-02-02 02:02:02',
            SmallerThanEquals => '2002-02-02 02:02:02',
        }

        OrderBy => [ 'UserLogin', 'UserCustomerID' ],                   # (optional)
        # ignored if the result type is 'COUNT'
        # default: [ 'UserLogin' ]
        # (all search fields possible which are defined in CustomerUserSearchFields)

        # Additional information for OrderBy:
        # The OrderByDirection can be specified for each OrderBy attribute.
        # The pairing is made by the array indices.

        OrderByDirection => [ 'Down', 'Up' ],                          # (optional)
        # ignored if the result type is 'COUNT'
        # (Down | Up) Default: [ 'Down' ]

        Result => 'ARRAY' || 'COUNT',                                  # (optional)
        # default: ARRAY, returns an array of change ids
        # COUNT returns a scalar with the number of found changes

        # Filter customer users by ValidIDs.
        # 1 - valid, 2 and 3 invalid (temporary invalid is not available on Keycloak side)
        ValidID => [                                                   # (optional)
            1,
        ],
        # By default, all customer users are returned.

        # Filter customer users by Valid state.
        # If 1, returns Valid customer users.
        # If 0, returns all customer users.
        Valid => 1,                                                    # (optional) Default 0.

        Limit => 100,                                                  # (optional)
        # ignored if the result type is 'COUNT'

        UserID => 7,                                                   # (optional)
        # Used only if Customer<-Group->User filter is enabled.
    );

Returns:

Result: 'ARRAY'

    $CustomerUserIDs = [ 1, 2, 3 ];

Result: 'COUNT'

    $CustomerUserIDs = 10;
Scroll to Top