Obtain a device fingerprint

The device_fingerprint is one of the required parameters for the methods to sign up and sign in to the B2Core UI.

To obtain a device fingerprint, do the following:

  1. Create a free-form JSON string that uniquely identifies your device. The JSON string must include the user_agent field among the other fields that you may want to include in it.

  2. Convert the created JSON string to a Base64 string.

  3. Include the generated Base64 string as the device_fingerprint parameter in your sign up and sign in requests.


The following example illustrates how to generate a device fingerprint string in PHP:

>>> $j = json_encode(["user_agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"])
=> "{"user_agent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko\/20100101 Firefox\/47.0"}"

>>> base64_encode($j)
=> "eyJ1c2VyX2FnZW50IjoiTW96aWxsYVwvNS4WIChXaW5kb3dZIE5UIDYUMTSgV2luNjQ7IHg2NDsgcnY6NDCUMCkR2Vja29cLzIwMTAwMTAXIEZpcmVmb3hcLzQ3LjAifQ=="