The iOS app Shared Secret, also known as the App Store Connect Shared Secret, is a 32 character hexadecimal string. It is used for server-side receipt validation. Specifically, the Shared Secret is sent to Apple in the request payload. This provides added security for receipts with auto-renewable subscriptions.
Receipt verification is a process app developers use to verify purchases. Specifically, this process if for purchases made using Apple’s App Store payments mechanism (aka StoreKit). The receipt provides a complete list of all the purchases made by an app’s user. The receipt includes both in-app purchases and subscriptions.
Apple recommends that app developers validate a receipt for security and piracy reasons. In fact, property security requires a secure backend.
The Shared Secret is allows you to receive the decoded form of a receipt. In addition, its included in the payload of App Store Server Notifications. You can check that the password key’s value matches the known Shared Secret verify the authenticity of the notification.
Two Types of iOS App Shared Secret
There are two flavors of Shared Secret that can be generated through App Store Connect.
- Primary Shared Secret - used across all apps in your Apple Developer account
- App-Specific Shared Secret - used for a specific app in your Apple Developer account
The App-Specific Shared Secret is a good idea if you want app-level security. Perhaps plan to transfer an app to another Apple Developer. For instance, if you sell an app to another party on a marketplace like Flippa.
To generate either type of Shared Secret requires an App Store Connect account with either Account Holder or Admin role.
Generating a Primary Shared Secret
To generate (or re-generate) a Primary Shared Secret, follow these steps:
- Sign-in to App Store Connect
- Navigate to Users and Access
- Navigate to Shared Secret
- Click Generate or Regenerate
Generating an App-Specific Shared Secret
To generate (or re-generate) an App-Specific Shared Secret, follow these steps:
- Sign-in to App Store Connect
- Navigate to My Apps
- Choose the app you want to generate a Shared Secret for
- Navigate to In-App Purchases under the Features heading
- Click App-Specific Shared Secret
- Click Generate or Regenerate