IamUtil.createUser()

DESCRIPTION

Create an IAM user on device.

See https://docs.nabto.com/developer/guides/concepts/iam/intro.html for an intro to the concept of users and roles.

DECLARATION

    static public func createUser(connection: Connection,
                                  username: String,
                                  password: String,
                                  role: String) throws 

PARAMETERS

connection:
An established connection to the device
username:
Username for the new user
password:
Password for the new user
role:
IAM role for the new user

THROWS ERRORS

BLOCKED_BY_DEVICE_CONFIGURATION:
if the device configuration does not allow the current user to create a new user (the IAM:CreateUser action is not allowed for the requesting role)
ROLE_DOES_NOT_EXIST:
the specified role does not exist in the device IAM configuration
IAM_NOT_SUPPORTED:
if Nabto Edge IAM is not supported by the device

RETURNS

an IamUser instance describing the current user