Skip to content

A demo of Apple's App Attest using SwiftUI and Vapor.

License

Notifications You must be signed in to change notification settings

Oliver-Binns/app-attest

Repository files navigation

App Attest Demo

Ensure that requests your server receives come from legitimate instances of your app using Apple’s App Attest - part of the DeviceCheck framework.

About

This sample code accompanies a talk about the Device Check framework which covered:

The talk was given at NSLondon on 21st November, 2024 at Apple Battersea, you can find the slides from the talk here.

Progress

This implementation currently covers:

  • Generating an App Attest key in Secure Enclave | App
  • Serving a challenge from server to app | Server
  • Attesting a key for the given challenge | App
  • Submitting the Attestation Object to the server | App
  • Receiving the Attestation Object from the app | Server
  • Decoding the Attestation Object for validation | Server
  • Validing the Attestation Object | Server
  • Acquiring fraud metrics from Apple using the receipt | Server
  • Storing Attestation Key for future assertions | Server
  • Generating assertion objects for authentication | App
  • Submitting the Assertion Object to the server | App
  • Receiving the Assertion Object from the app | Server
  • Decoding the Assertion Object for validation | Server
  • Validating the Assertion Object | Server
  • Make AttestationDecoding & AttestationValidation targets available as a Swift Package

Requirements

  • iOS 14.0+
  • Latest version of Xcode
  • Swift 5.0+

Getting Started

  1. Clone the repository
git clone https://github.com/Oliver-Binns/app-attest.git
  1. Open the project in Xcode
  2. Build and run the sample application

Contributing

Pull requests and feature requests are welcome - this sample code is developed fully in the open.

SwiftLint is run against all code, please ensure you have this installed so that pre-commit hooks can run successfully.

Conventional Commits are required for each pull request to ensure that release versioning can be managed automatically. Please ensure that you have enabled the Git hooks, so that you don't get caught out!:

git config core.hooksPath hooks

The progress section above covers some future enhancements that you could contribute.

Additional Resources

About the Author

Oliver is an experienced mobile software engineer based in London. After attaining an IET accredited master’s degree in Computer Science from the University of York, he started his career building websites in PHP and JavaScript, before pivoting into native iOS development. He has led teams to scale apps from first lines of code to #1 on the App Store and Google Play Store.

About

A demo of Apple's App Attest using SwiftUI and Vapor.

Topics

Resources

License

Stars

Watchers

Forks