IamUtil.PairPasswordOpenAsync()

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.

DECLARATION

System.Threading.Tasks.Task PairPasswordOpenAsync(Nabto.Edge.Client.IConnection, System.String, System.String)

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

ERRORS

  • T:Nabto.Edge.ClientIam.IamException: Thrown with Nabto.Edge.ClientIam.IamError if desiredUsername is already in use on the device.
  • T:Nabto.Edge.ClientIam.IamException: Thrown with Nabto.Edge.ClientIam.IamError if the open pairing password was invalid for the device.
  • T:Nabto.Edge.ClientIam.IamException: Thrown with Nabto.Edge.ClientIam.IamError if desiredUsername is not valid as per https://docs.nabto.com/developer/api-reference/coap/iam/post-users.html#request.
  • T:Nabto.Edge.ClientIam.IamException: Thrown with Nabto.Edge.ClientIam.IamError if the initial user was already paired.
  • T:Nabto.Edge.ClientIam.IamException: Thrown with Nabto.Edge.ClientIam.IamError if the device configuration does not support local open pairing (the IAM:PairingPasswordOpen action is not set for the Unpaired role or the device does not support the pairing mode at all).
  • T:Nabto.Edge.ClientIam.IamException: Thrown with Nabto.Edge.ClientIam.IamError if the client has attempted to authenticate too many times with a wrong password (try again after 10 seconds).
  • T:Nabto.Edge.ClientIam.IamException: Thrown with Nabto.Edge.ClientIam.IamError if the pairing mode is configured on the device but is disabled at runtime.
  • T:Nabto.Edge.ClientIam.IamException: Thrown with Nabto.Edge.ClientIam.IamError if Nabto Edge IAM is not supported by the device.