createUsers method

Future<bool> createUsers(
  1. List<User> users
)

This operation creates new device users and corresponding credentials on a device for authentication purposes. The device shall support creation of device users and their credentials through the CreateUsers command. Either all users are created successfully or a fault message shall be returned without creating any user.

ONVIF compliant devices are recommended to support password length of at least 28 bytes, as clients may follow the password derivation mechanism which results in 'password equivalent' of length 28 bytes, as described in section 3.1.2 of the ONVIF security white paper.

Access Class: WRITE_SYSTEM

Implementation

Future<bool> createUsers(List<User> users) async {
  loggy.debug('createUsers');

  final responseEnvelope = await transport.securedRequest(
      uri,
      soap.Body(
        request: DeviceManagementRequest.createUsers(users),
      ));

  if (responseEnvelope.body.hasFault) {
    throw Exception(responseEnvelope.body.fault.toString());
  }

  return true;
}