Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2021 Privacy & Security

WWDC21 · 19 min · Privacy & Security

Mitigate fraud with App Attest and DeviceCheck

Discover how to use App Attest and DeviceCheck, Apple’s powerful anti-fraud tools, created to safeguard your apps and content. Unlock the secrets of deploying App Attest by incorporating it into your app to block unauthorized modifications of your app and content. We’ll also show you how to use DeviceCheck to ensure you can distinguish between customers who have received premium content in your app, and those who have attained it through illegitimate means.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 3 snippets

Create an App Attest key swift · at 8:02 ↗
let appAttestService = DCAppAttestService.shared

if appAttestService.isSupported {
    appAttestService.generateKey { keyId, error in
        guard error == nil else { /* Handle the error. */ }
        // Cache keyId for subsequent operations.
    }
} else {
   // Handle fallback as untrusted device
}
Generate key attestation swift · at 9:34 ↗
appAttestService.attestKey(keyId, clientDataHash: clientDataHash) { attestationObject, error in
    guard error == nil else { /* Handle error. */ }

    // Send the attestation object to your server for verification.
}
Generate assertion swift · at 13:14 ↗
appAttestService.generateAssertion(keyId, clientDataHash: clientDataHash) { assertionObject, error in
    guard error == nil else { /* Handle error. */ }
    
    // Send assertion object with your data to your server for verification
}

Resources