Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

SDK Hardware Authentication Scenarios

Exhibit Online

noInternetConnection: false

Normal Gumband Cloud connectivity

Once the exhibit SDK has initialized, it will use hardware list (ie. connected hardware from the web UI) to know which hardwareIds to allow. It then authenticates using the token against the Gumband Cloud before allowing peripheral messages.

If the exhibit SDK does not yet have the hardware list when hardware connects, those hardware connections are added to a "Waiting for Auth" queue.

Exhibit Offline

noInternetConnection: false

No Gumband Cloud connectivity

Once the exhibit SDK has initialized, it will use hardware list to allow future connections to those hardwareIds without authentication (as if noInternetConnection: true) until the Gumband Cloud connection is re-established. Once the connection is re-established, any existing hardwareId connections that are no longer valid are immediately disconnected.

Exhibit Offline Mode

noInternetConnection: true

No Gumband Cloud connectivity

Once the exhibit SDK has initialized, it will use the noInternetHardwareIds list to allow connections to those hardwareIds without authentication.

SDK “Waiting for Auth” Queue

Had to add a “waiting for auth” state where hardware sockets would connect, but the exhibit hasn’t received the connected hardware list from the platform yet (noInternetConnection: false). When it does, it would send the message to ask for auth on that client. If it doesn’t, it will disconnect is 10s and then assuming the hardware would try to reconnect and repeat the cycle until it connects.

TODO: If the SDK disconnects due to no hardwareID in this queue, it should respond per the updated MQTT spec.

{
  "text": "id" 
}

How Two MQTT Connections for the Same Hardware ID Respond

If two connections try to authenticate with the same hardwareId, the SDK responds whether or not the existing connection is authenticated. If that case is true, then the new hardware connection is rejected. If the existing connection is not authenticated (ie. in the “Waiting for Auth” queue), then that connection will be severed and the new connection will be accepted.

SDK HARDWARE_ONLINE & HARDWARE_OFFLINE Callbacks

The exhibit SDK emits a HARDWARE_ONLINE event with the after a hardware connection is established and successfully authenticates. It also emits a HARDWARE_OFFLINE event if the MQTT heartbeat for a particular harwareId connection isn’t received within 20 seconds. Both events contain the following payload

{
  hardwareId: 123,
  name: 'Exhibit Gizmo'
}

  • No labels