This is a translation of the original English documentation page. Help us make it better.

mfa.get

Beschrijving

integer/array mfa.get(object parameters)

De methode maakt het mogelijk om MFA-methoden op te halen volgens de opgegeven parameters.

Deze methode is alleen beschikbaar voor het gebruikerstype Super admin. Rechten om de methode aan te roepen, kunnen worden ingetrokken in de instellingen van de gebruikersrol. Zie Gebruikersrollen voor meer informatie.

Parameters

(object) Parameters defining the desired output.

The method supports the following parameters.

Parameter Type Description
mfaids ID/array Return only MFA methods with the given IDs.
selectUsrgrps query Return a usrgrps property with user groups associated with MFA methods.

Supports count.
filter object Return only those results that exactly match the given filter.

Accepts an object, where the keys are property names, and the values are either a single value or an array of values to match against.

Supports properties:
mfaid - ID of the MFA method;
type - Type of the MFA method.
sortfield string/array Sort the result by the given properties.

Possible values: name.
search object Return results that match the given pattern (case-insensitive).

Possible values: name.
countOutput boolean These parameters being common for all get methods are described in detail in the reference commentary page.
excludeSearch boolean
limit integer
output query
preservekeys boolean
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch boolean

Retourwaarden

(integer/array) Geeft ofwel:

  • een reeks objecten;
  • het aantal opgehaalde objecten, als de parameter countOutput is gebruikt.

Voorbeelden

Finding MFA methods by name

Retrieve all MFA methods with "Zabbix" in their name.

Request:

{
           "jsonrpc": "2.0",
           "method": "mfa.get",
           "params": {
               "output": "extend",
               "search": {
                   "name": "Zabbix"
               }
           },
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": [
               {
                   "mfaid": "1",
                   "type": "1",
                   "name": "Zabbix TOTP 1",
                   "hash_function": "1",
                   "code_length": "6",
                   "api_hostname": "",
                   "clientid": ""
               },
               {
                   "mfaid": "2",
                   "type": "1",
                   "name": "Zabbix TOTP 2",
                   "hash_function": "3",
                   "code_length": "8",
                   "api_hostname": "",
                   "clientid": ""
               }
           ],
           "id": 1
       }

Bron

CMfa::get() in ui/include/classes/api/services/CMfa.php.