Layer 1: device and geo per login
On every authenticated session, the webhook carries the DeviceID and Country for that account’s
UserHID. Compare them against the account’s known devices in real time.Layer 2: Abuse Patterns over time
Server-side Abuse Patterns that link an account across sessions: “Many Devices on One Account”, “Multiple Countries on One Account”, “New Device and New Country on One Account”. Read on the dashboard.
Account sharing is a policy question, not a fraud verdict. A family plan, a shared team login, and a resold credential can all look like “many devices on one account.” ShieldLabs tells you the spread; your terms of service decide what is allowed.
How the two layers work together
| Layer | What it answers | Where you read it | Latency |
|---|---|---|---|
| Per-session device/geo | ”Is this account on a new device or in a new country right now?” | Webhook / History API | Real time (~1s) |
| Abuse Patterns | ”Has this account spread across many devices or countries over time?” | Dashboard Patterns + export | Background (~10 min) |
Layer 1: check the device on every authenticated session
CallcheckAuthenticatedUser with the account’s hashed id (UserHID) on login and on sensitive actions. The webhook then carries the DeviceID, Country, and UserHID for that session, so your backend can compare against what it already knows about the account.
app.html
RequestID from the webhook cache (or the History API), then checks the DeviceID against the account’s known devices.
api/session-check.js
Layer 2: see the spread with Abuse Patterns
A single new device is easy to read. The harder signal is an account that quietly appears on a dozen devices, or from several countries within an hour. That is what Abuse Patterns surface, grading each account Normal → Suspicious → Dangerous as the linked count crosses thresholds in a rolling window.Many Devices on One Account
Many Devices on One Account
One account used from many different devices. The core account-sharing and account-resale shape. The grouping identity is the UserHID; the spread is counted in distinct DeviceIDs over a rolling window (default 30 days).
Multiple Countries on One Account
Multiple Countries on One Account
The same account active from several countries in a short window (24 hours). Catches a credential shared across regions, or one used behind rotating VPN exits. Note that a real traveler can trip this, so read it with the device spread.
New Device and New Country on One Account
New Device and New Country on One Account
An existing account suddenly appears from a device and a country it has never used together. A strong account-takeover or hand-off signal, distinct from steady sharing.
Reconstruct an account’s spread programmatically
You can also compute the spread yourself from the History API. Search byuser_hid and count the distinct devices and countries.
Read one account's history
Count devices and countries per account
The History API bills 1 request per returned row (an empty result still bills 1). For routine enforcement, prefer the pre-computed pattern export from the dashboard as your watchlist, and reserve live
user_hid reads for the accounts you are actively investigating.Putting it together
Identify authenticated sessions
Call
checkAuthenticatedUser with the hashed UserHID on login and sensitive actions. See Snippet setup.Track known devices per account
On each webhook, record the
DeviceID and Country against the account in your own store, so you can tell a new device from a familiar one.Act on a new device (Layer 1)
Allow a known device. For a new one over your limit, require re-authentication or notify the account owner. Your policy, your thresholds.
Watch the patterns (Layer 2)
Pull “Many Devices on One Account” and “Multiple Countries on One Account” from the dashboard and review the Dangerous accounts.
Recommended starting policy
A guide, not a rule. The right device and country limits depend entirely on your product.| Signal | Suggested action |
|---|---|
| Known device, known country | Allow |
| New device, within your device limit | Notify the account owner, remember the device |
| New device, over your device limit | Require re-authentication on the new device |
| ”Multiple Countries on One Account” (Suspicious or Dangerous) | Step up verification, review against your sharing policy |
| ”New Device and New Country” (Dangerous) | Treat as possible takeover: force re-auth, see Login and 2FA |
Next: Acting on the Risk Score
The full decision playbook, including how to combine identity spread with the per-session Risk Score and its Details.