Troubleshooting
Redirect URLs
When using redirect or deviceRedirect, the URL must be accessible from the scanning device. The following will not work:
localhost127.0.0.10.0.0.0
Use a network IP address or domain name accessible to the scanning device.
Callback Naming
When using DeviceAssure.qr(), your callback can have any name — the library internally wires it to the global _deviceAssureResultReceived function.
However, if you use the raw snippet directly (without the library wrapper), you must define the callback with the exact name _deviceAssureResultReceived:
<script src="https://qr-code.deviceatlas.com/v2/api/snippet.js?dv-licenceKey=<LICENCE_KEY>"></script>
<script>
function _deviceAssureResultReceived(result) {
console.log('Result:', result);
}
</script>
Content Security Policy (CSP)
If your site uses a Content Security Policy, the following domains must be allowed for QR code functionality:
Content-Security-Policy: frame-src 'self' https://qr-code.deviceatlas.com;
script-src 'self' https://cdn.devicevalidation.io https://qr-code.deviceatlas.com;
connect-src 'self' https://api1.devicevalidation.io https://api2.devicevalidation.io https://api3.devicevalidation.io;
| Directive | Domain | Purpose |
|---|---|---|
frame-src | qr-code.deviceatlas.com | QR code iframe |
script-src | cdn.devicevalidation.io | Web library scripts |
script-src | qr-code.deviceatlas.com | QR code scripts |
connect-src | api1.devicevalidation.io | DeviceAssure API (primary) |
connect-src | api2.devicevalidation.io | DeviceAssure API (fallback) |
connect-src | api3.devicevalidation.io | DeviceAssure API (fallback) |
See Also
- Quick Start Guide - Getting started with QR code verification
- Examples - Implementation examples
- Configuration Options - All available parameters