Android development / Advanced: reliable mobile systems and releases / Lesson 21
App Links verification and authorization
Understand Android App Link domain verification, signing identity and the separate server authorization boundary.
On this page
Lesson goals
- Explain the manifest and domain association.
- Trace signing identity and verification evidence.
- Validate incoming links and authorize the requested record.
Define the association
Android App Links connect supported web URLs to an application through a verified association with a domain. An intent filter declares the host and requests verification; the website supplies a Digital Asset Links statement identifying the app and signing certificate. Use a domain you control and verify the actual release signing identity. Association does not authenticate the user or authorize access to a record.
Declare the intent filter
This manifest fragment declares a browsable HTTPS link for a synthetic domain and an exported receiving activity. It must be placed in a complete manifest with the appropriate Android namespace and application configuration. The example host is illustrative and is not a controlled production domain. Validate the incoming URI and handle unsupported paths in the receiving application.
<activity android:name=".MainActivity" android:exported="true">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="workshop.example" />
</intent-filter>
</activity>
Android can attempt domain verification for the declared host.
The filter requests verification for HTTPS links to the example host.
Publish the corresponding statement
The website serves assetlinks.json at its documented well-known HTTPS path. The package name and certificate fingerprint must correspond to the actual installed signing identity. This synthetic all-zero fingerprint is deliberately not a real certificate and must not be deployed as an association. Signing configurations can differ between local and distributed artifacts; inspect the identity of the specific build being tested.
[
{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.example.workshop",
"sha256_cert_fingerprints": ["00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00"]
}
}
]
The synthetic statement does not verify a real application.
The statement illustrates the required relationship and identity fields with nonproduction values.
Validate and authorize separately
A verified domain can route a link to the app, but a URI remains external input. Parse expected paths and parameters, reject unsupported destinations and request the specific data through an authenticated server operation. Test another userโs record with synthetic accounts. Follow platform-version guidance for verification and user link preferences rather than assuming every device or install has the same state.
Verify on a target
Use a test domain under your control and a signed test build, then inspect domain verification status using the official platform instructions. Open matching and nonmatching links and test a direct unauthorized record request. Record the device version, package and signing identity without exposing private keys. A valid JSON file or manifest declaration alone does not prove that a device verified the association.
Common errors and fixes
The app does not become the verified handler.
- Why it happens
- The domain statement or signing fingerprint does not match the installed artifact.
- How to fix it
- Correct the controlled domain association for the actual signing certificate.
- Prevent it next time
- Test the release signing identity and verification status.
An unsupported URI reaches an unsafe operation.
- Why it happens
- The app trusted a matching host without validating its path and parameters.
- How to fix it
- Parse and validate the incoming URI.
- Prevent it next time
- Test malformed and unexpected paths.
A verified link exposes another userโs record.
- Why it happens
- Domain verification was mistaken for object authorization.
- How to fix it
- Authorize the requested record on the server.
- Prevent it next time
- Test direct requests with separate synthetic accounts.
2 practice exercises
1. Does autoVerify alone prove that a device verified a domain?
Show worked solution
No. The device must obtain and validate a matching domain statement and signing identity. Inspect verification status on the intended target using official guidance.
2. Why is the all-zero fingerprint unsuitable for deployment?
Show worked solution
It is synthetic and does not identify the real signed application. A controlled domain must publish the actual authorized certificate fingerprint for the artifact.
Key takeaways
- App Links verify an app-domain association.
- Validate all incoming URI data.
- Authorize records independently on the server.