Digitial Asset Linking
Link your Android App to your website
For Credential Manager to work to the best of its ability, it's suggested that you set up your Digitial Asset Linking.
What Is Digital Asset Linking
Digital Asset Linking is a mechanism in Android that allows apps and websites to verify their connectivity and common ownership. By creating a JSON file in a specific location on your web server, you can declare that your app and website are linked. This enables shared permissions and functionalities, such as enabling your app to handle specific types of links that are used on your website. It's a crucial step to ensure seamless user experiences across platforms and enhances security by confirming app and web relationships.
Defining Your Digital Asset Linking JSON File
Below is an example assetlinks.json
file that is available on my domain for the example app of this package to work.
Let's break down what this JSON file does.
We define relation at the start. This tells Android what should be linked between your app and your website. In our case, we want to link the credentials and also to handle all the urls.
Next, we have target. Here only the
package_name
and thesha256_cert_fingerprints
have importance to us. The package name is the name of your Android app identifier andsha256_cert_fingerprints
can be generated by running the below command.
Hosting your DigitalAsset.json file
Host the Digital Assets Link JSON file at the following location on the sign-in domain:
For example, if your sign-in domain is signin.example.com
, host the JSON file at https://signin.example.com/.well-known/assetlinks.json
.
The MIME type for the Digital Assets Link file needs to be JSON. Make sure the server sends a Content-Type: application/json
header in the response.
Last updated