Device binding
Device binding restricts the devices that agents can use to work with Unblu in your agent mobile app. Each agent binds their installation of the app to their Unblu user. Once you enforce device binding, sessions that require it can only use Unblu from a bound device.
Device binding is only available for agent apps. Only users with the REGISTERED_USER role or higher can bind a device. The app must use the INTERNAL entry path to bind a device.
You implement the app side of device binding with the integrity module of the Unblu mobile SDKs.
How device binding works
When an agent binds a device, the app creates a key pair on the device. The Collaboration Server stores the public key with the binding.
To prove that the device is still bound, the app verifies the binding:
-
The app requests a challenge from the Collaboration Server.
-
The app signs the challenge with the device’s private key and sends the signature back.
-
The Collaboration Server checks the signature against the stored public key and records when the device was verified.
A verification only counts for a limited period, called the verification period. Your app must verify the binding again before the period ends, for example whenever it starts or returns to the foreground.
Enforcing device binding means that the Collaboration Server checks calls from sessions that require binding. The check covers every call to the Unblu web API and to the internal API that the Unblu UIs use. The Collaboration Server only lets a call through if both of the following are true:
-
The device the call comes from has an active binding for the logged-in agent.
-
The binding was verified within the verification period.
The Collaboration Server doesn’t check requests for pages and static resources, such as JavaScript and CSS files. It also doesn’t check calls made before the agent logs in, or calls the app needs to log in, bind the device, and verify the binding.
When the Collaboration Server rejects an Unblu UI’s connection, the UI stops trying to reconnect and displays an error message such as the following:
This device is no longer verified for device binding. Please re-verify the device in the app and try again.
Configuring device binding
The properties in the com.unblu.mobiledevice.v2.server.core.devicebinding.config.DeviceBindingConfiguration group configure device binding.
Sessions that require device binding
By default, com.unblu.devicebinding.enforcementMode is DISABLED. To enforce device binding, set the property to one of the following values:
-
HEADER: A session requires binding if its requests carry the header named in com.unblu.devicebinding.mobileIndicatorHeaderName. The default header name isx-unblu-device-binding-required. -
IP_RANGE: A session requires binding if its source IP address is outside the ranges listed in com.unblu.devicebinding.internalIpRanges. -
HEADER_AND_IP_RANGE: A session requires binding if its requests carry the header and its source IP address is outside the internal ranges. -
HEADER_OR_IP_RANGE: A session requires binding if its requests carry the header or its source IP address is outside the internal ranges.
The modes that use the header only check whether the header is present, not its value. Configure the proxy or firewall in front of Unblu to add the header to every request from the app. Make sure that requests from the app can only reach Unblu through the proxy or firewall.
Agent Desk sessions in desktop browsers can’t be bound, so make sure that they don’t require binding:
-
HEADER: Their requests must not carry the header. -
IP_RANGE: Their source IP address must be in the internal ranges. -
HEADER_AND_IP_RANGE: Their requests must not carry the header, or their source IP address must be in the internal ranges. -
HEADER_OR_IP_RANGE: Their requests must not carry the header, and their source IP address must be in the internal ranges.
By default, com.unblu.devicebinding.internalIpRanges is empty. In the IP_RANGE and HEADER_OR_IP_RANGE modes, every session then requires binding, including Agent Desk sessions in desktop browsers.
Validity periods and limits
-
com.unblu.devicebinding.verifiedValiditySeconds determines how long a verification counts. The default is 1 day.
-
com.unblu.devicebinding.registrationTokenTtlSeconds determines how long the token for binding a device remains valid. The default is 5 minutes.
-
com.unblu.devicebinding.enrollmentChallengeTtlSeconds determines how long the challenge for binding a device remains valid. The default is 60 seconds.
-
com.unblu.devicebinding.challengeTtlSeconds determines how long the challenge for verifying a binding remains valid. The default is 60 seconds.
-
com.unblu.devicebinding.maxBindingsPerUser determines how many active bindings an agent can have. The default is 1. Once an agent has reached the limit, binding another device fails. The agent has to unbind one of their devices first.
Cleanup
A background job deletes expired tokens and challenges, revoked bindings, and bindings that haven’t been verified for a long time. The following properties control the job:
-
com.unblu.devicebinding.expirationScannerEnabled determines whether the job runs. The default is
true. -
com.unblu.devicebinding.expirationScannerIntervalMinutes determines how often the job runs. The default is 60 minutes.
-
com.unblu.devicebinding.revokedBindingRetentionDays determines how long the job keeps revoked bindings. The default is 30 days.
-
com.unblu.devicebinding.orphanedBindingGraceMinutes determines how long the job keeps a binding after its verification period has ended without a new verification. The default is 1 year.
Binding a device
Agents bind their devices themselves. Nobody can bind a device for another agent.
To bind a device, agents do the following:
-
In the Agent Desk, open the Devices tab of their user profile.
-
Click New mobile binding.
The New mobile binding dialog opens on the Binding QR code tab.
-
Scan the QR code with the app.
Alternatively, open the Token tab and enter the token shown there in the app.
The dialog closes once the device is bound.
The QR code contains the same token that the Token tab shows. The token is a random string that can only be used once. The dialog counts down the time until the token expires. To get a new token, click Generate new token.
For more information, refer to Device binding in Android apps and Device binding in iOS apps.
When a device loses its binding
A device loses its binding in the following cases:
-
The agent clicks Unbind on the Devices tab of their user profile.
-
A supervisor or a user with the
ADMINorSUPER_ADMINrole clicks Unbind on the Devices tab of the agent’s user details. Supervisors can only do so for agents in their team or one of its subteams. -
The app revokes the binding.
-
The device fails an integrity check: Google Play Integrity on Android or Apple DeviceCheck on iOS returns a negative verdict. In addition, the Collaboration Server logs the device out and disconnects the agent from their open sessions. A check that can’t be carried out, for example because the verification service is unreachable, doesn’t affect the binding. For more information, refer to Android attestation and iOS attestation.
-
The cleanup job deletes the binding because it hasn’t been verified for a long time.
To use the device again, the agent has to bind it again. If the binding was revoked with Unbind or after a failed integrity check, the app must call resetKeyPair first.
See also
-
For more information, refer to Device binding in Android apps.
-
For more information, refer to Device binding in iOS apps.
-
For more information, refer to Agent Desk user profile.
-
For more information on unbinding an agent’s device, refer to Managing devices.