Verify signed-in visitors in the widget
Sign your users' e-mail addresses on your server so that widget messages from them count as verified, and optionally require it.
If people sign in to your own website or app, the widget can tell Aoun who they are. Your server signs the user's e-mail address with a secret only you and Aoun know. Messages from a signed user are verified at once; anyone who types an existing customer's address without a signature is marked E-mail not verified (see Handle unverified requests).
Turn it on
- Go to Settings, then Widget.
- Under Identity verification, select Turn on and create a secret.
- Copy the Identity secret into your server's configuration.
Warning
Keep the secret on your server. Never put it in the page, in JavaScript sent to the browser, or in a mobile app.
Add the signature to the page
On pages where the visitor is signed in, use Embed code for a signed-in user in place of the usual embed code:
<script src="https://aoun.woosool.com/widget.js"
data-aoun-key="YOUR_WIDGET_KEY"
data-aoun-email="ana@example.com"
data-aoun-name="Ana Haddad"
data-aoun-user-hash="SIGNATURE"
async></script>
SIGNATURE is the HMAC-SHA256 of the user's e-mail address, trimmed and in lower case, with your identity secret as the key, written in hexadecimal. Compute it on your server for each signed-in user.
Node.js:
import crypto from 'node:crypto';
const userHash = crypto
.createHmac('sha256', process.env.AOUN_IDENTITY_SECRET)
.update(user.email.trim().toLowerCase())
.digest('hex');
PHP:
$userHash = hash_hmac(
'sha256',
mb_strtolower(trim($user->email)),
getenv('AOUN_IDENTITY_SECRET')
);
Python:
import hashlib, hmac, os
user_hash = hmac.new(
os.environ["AOUN_IDENTITY_SECRET"].encode(),
user.email.strip().lower().encode(),
hashlib.sha256,
).hexdigest()
To check your code, compare with the command line: echo -n 'ana@example.com' | openssl dgst -sha256 -hmac 'YOUR_SECRET'.
Pages for visitors who are not signed in keep the usual embed code.
Require identity verification
To accept widget and chat messages only from signed users:
- Go to Settings, then Security.
- Turn on Require identity verification for signed-in visitors.
Visitors without a valid signature then see Sign in on this website to contact us. in the widget, and their messages and chats are refused. The web form and the customer portal are not affected: customers can still reach you there.
The switch needs an identity secret. If you turn identity verification off, it is switched off too.
Change or remove the secret
- Create a new secret replaces the old one at once. Users signed with the old secret are no longer verified until your site uses the new one, so update your server right away.
- Turn off removes the secret. Every address typed in the widget becomes a claim again.
Was this article helpful?
Related articles
- Handle requests marked “E-mail not verified”Why a request is marked “E-mail not verified”, how the customer confirms it, and how spam and blocked senders work.
- Portal, web form and widgetLet customers contact you and follow their requests without an account.
- Chat with customers liveAnswer customers in real time from the widget and the portal, and turn a chat into a ticket.
Still need help?
Write to the Woosool team. Sign in with your Woosool Account and we reply by e-mail and in My requests.

