Identity validation ensures that conversations between your customers and support agents are private and secure. It also prevents someone from impersonating another user through the chat widget.
This feature can be enabled by generating an HMAC (Hash-based Message Authentication Code).
Where to Find the Token for HMAC Generation
To generate the signature correctly, you need the validation token provided by Akece. You can find it in your dashboard:
Settings β Inboxes β Configuration β Identity Validation
Click Copy Token to copy it.
How to Generate the HMAC
Below are code examples to generate the identifier_hash
using the userβs identifier
, in different programming languages:
PHP
<?php
$key = '<widget-hmac-token>';
$message = '<identifier>';
$identifier_hash = hash_hmac('sha256', $message, $key);
?>
JavaScript (Node.js)
const crypto = require('crypto');
const key = '<widget-hmac-token>';
const message = '<identifier>';
const hash = crypto.createHmac('sha256', key).update(message).digest('hex');
Ruby
require 'openssl'
key = '<widget-hmac-token>'
message = '<identifier>'
OpenSSL::HMAC.hexdigest('sha256', key, message)
Elixir
key = '<widget-hmac-token>'
message = '<identifier>'
signature = :crypto.mac(:hmac, :sha256, key, message)
Base.encode16(signature, case: :lower)
Golang
package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
)
func main() {
secret := []byte("<widget-hmac-token>")
message := []byte("<identifier>")
hash := hmac.New(sha256.New, secret)
hash.Write(message)
hex.EncodeToString(hash.Sum(nil))
}
Python
import hashlib
import hmac
secret = b'<widget-hmac-token>'
message = b'<identifier>'
hash = hmac.new(secret, message, hashlib.sha256)
print(hash.hexdigest())
If you need help setting up identity validation for your widget, feel free to reach out:
π© [email protected]
π± @akece.ai