Upload an Android assetlinks.json File

Overview

To help you integrate your Android apps with Identity Cloud, you can upload an Android assetlinks.json to your Identity Cloud environment. The assetlinks.json file lets your website declare an association with your Android apps.

To upload the file, use the the /.well-known/assetlinks.json endpoint in the REST API. The endpoint is accessed using a custom domain.

Make sure that you have already set up a custom domain for each environment and realm where you need to upload an Android assetlinks.json file.
  1. Create an access token for the realm that is using the custom domain. See Get an access token.

  2. Upload or replace the assetlinks.json file:

    Show request
    curl \
    --request PUT '<custom-domain-url>/.well-known/assetlinks.json' \ (1)
    --header 'Authorization: Bearer <access_token>' \ (2)
    --header 'Content-Type: application/json' \
    --data-raw '[ (3)
      {
        "relation": [
          "delegate_permission/common.handle_all_urls",
          "delegate_permission/common.get_login_creds"
        ],
        "target": {
          "namespace": "web",
          "site": "https://id.mycompany.com"
        }
      }
    ]'
    1 Replace <custom-domain-url> with your custom domain, for example id.mycompany.com.
    2 Replace <access-token> with the access token.
    3 Replace the example assetlinks.json JSON content with your own JSON content.
    Show response
    [
        {
            "relation": [
                "delegate_permission/common.handle_all_urls",
                "delegate_permission/common.get_login_creds"
            ],
            "target": {
                "namespace": "web",
                "site": "https://id.mycompany.com"
            }
        }
    ]
An access token is not needed to to view the assetlinks.json file as it is publicly accessible.
  1. View the assetlinks.json file using a GET request:

    Show request
    curl \
    --request GET '<custom-domain-url>/.well-known/assetlinks.json'
    Show response
    {
        "relation": [
            "delegate_permission/common.handle_all_urls",
            "delegate_permission/common.get_login_creds"
        ],
        "target": {
            "namespace": "web",
            "site": "https://id.mycompany.com"
        }
    }
  1. Create an access token for the realm that is using the custom domain. See Get an access token.

  2. Delete the assetlinks.json file:

    Show request
    curl \
    --request DELETE '<custom-domain-url>/.well-known/assetlinks.json' \ (1)
    --header 'Authorization: Bearer <access_token>' \ (2)
    1 Replace <custom-domain-url> with your custom domain, for example id.mycompany.com.
    2 Replace <access-token> with the access token.
    Show response
    [
        {
            "relation": [
                "delegate_permission/common.handle_all_urls",
                "delegate_permission/common.get_login_creds"
            ],
            "target": {
                "namespace": "web",
                "site": "https://id.mycompany.com"
            }
        }
    ]