Identity Verification

Noel Lynagh Updated by Noel Lynagh

Adding Identity Verification offers you an extra layer of user protection. Identity Verification requires that you generate an HMAC on your server for each logged-in user and pass it to TABLE.

-

  1. To generate an HMAC in PHP:
hash_hmac(
'sha256', // hash function
$user->id, // your user's id
'<TABLE_SECRET>' // secret key
);
  1. To generate an HMAC in Python:
import hmac
import hashlib

hmac.new(
b'<TABLE_SECRET>', # table secret
bytes(request.user.id, encoding='utf-8'), # your user's id
digestmod=hashlib.sha256 # hash function
).hexdigest()
  1. To generate an HMAC in Ruby:
OpenSSL::HMAC.hexdigest(
'sha256', # hash function
'<TABLE_SECRET>', # table secret
current_user.id # your user's id
)
  1. Everywhere that you load user data and have a window.tableSettings code snippet, add a new attribute called user_hash and assign the HMAC code for the logged-in user to it:
<script>
window.tableSettings = {
short_code: '{EXPERIENCE_SHORT_CODE}',
first_name: "John",
last_name: "Doe",
email: "johndoe@example.com",
user_hash: "INSERT_HMAC_VALUE_HERE",
created_at: 1258929196
};
</script>
<script id='__table_iac' src="https://{CUSTOMER_ID}.table.co/static/widget/inappchat.js" async>​</script>​

---

---

How did we do?

Install TABLE on your web app (for logged-out users)

Contact