IamUtil.pairPasswordOpen()
DESCRIPTION
Perform Password Open pairing, requesting the specified username and authenticating using the specified password.
In this mode a device has set a password which can be used in the pairing process to grant a client access to the device. The client can pair remotely to the device if necessary; it is not necessary to be on the same LAN.
This function blocks until it has succeeded.
Read more here: https://docs.nabto.com/developer/guides/iam/pairing.html#open-password
DECLARATION
public abstract void pairPasswordOpen(Connection connection, String desiredUsername, String password)
PARAMETERS
connection:- An established connection to the device this client should be paired with
desiredUsername:- Assign this username on the device if available (pairing fails with .USERNAME_EXISTS if not)
password:- the common (not user-specific) password to allow pairing using Password Open pairing
THROWS EXCEPTIONS
IamException:- with IamError
USERNAME_EXISTSif desiredUsername is already in use on the device IamException:- with IamError
AUTHENTICATION_ERRORif the open pairing password was invalid for the device IamException:- with IamError
INVALID_INPUTif desiredUsername is not valid as per https://docs.nabto.com/developer/api-reference/coap/iam/post-users.html#request IamException:- with IamError
INITIAL_USER_ALREADY_PAIREDif the initial user was already paired IamException:- with IamError
BLOCKED_BY_DEVICE_CONFIGURATIONif the device configuration does not support local open pairing (theIAM:PairingPasswordOpenaction is not set for the Unpaired role or the device does not support the pairing mode at all) IamException:- with IamError
PAIRING_MODE_DISABLEDif the pairing mode is configured on the device but is disabled at runtime IamException:- with IamError
IAM_NOT_SUPPORTEDif Nabto Edge IAM is not supported by the device