目录

Configuring the Client ID

Obtaining the Client ID and App ID

In AppGallery Connect, go to Apps and atomic services, and select the atomic service for which you want to request a scope. In the navigation pane on the left, choose Basic services > Project settings. On the displayed General information tab page, obtain the client ID and app ID of the atomic service in the App information area.

Checking the Necessity of Client ID Configuration

If the client ID and app ID obtained in the previous section are the same, it is unnecessary to configure the client ID. Otherwise, you need to configure the client ID as instructed in the next section.

Configuring the Client ID

In the module.json5 file of the entry module in the project, add the metadata section. Set name to client_id and value to the client ID obtained in the previous section.

  1. If the project has multiple modules, configure the client ID of your atomic service in the module.json5 file in the module whose type is entry.

  2. Ensure that the obtained client ID is the client ID of your atomic service. Using the project's client ID by mistake will result in API call errors.

"module": {
  "name": "<name>",
  "type": "entry",
  "description": "<description>",
  "mainElement": "<mainElement>",
  "deviceTypes": [],
  "pages": "<pages>",
  "abilities": [],
  "metadata": [ // The configuration is as follows.
    {
      "name": "client_id",
      "value": "xxxxx" // Assign the previously obtained client ID to the value field. Make sure not to set value using any other method.
    }
  ]
 }