Huawei Cloud integration (OAuth + AK/SK)

Huawei account sign-in, Huawei Cloud AK/SK, and CodeArts credentials are three separate paths: they handle sign-in, cloud resources, and CodeArts execution. None of them can substitute for another.

Use cases

Scenario Which path to use Where in Grape When it is needed
Sign in to Grape with a Huawei account Huawei account OAuth Sign-in page → Huawei account When users should sign in with HUAWEI ID
Create AI DevSpace, use DevBridge Huawei Cloud AK/SK User settings → Credentials → Cloud platform credentials When using the zero-install experience or cloud deployment
SRE operates ECS / VPC / RDS and other cloud resources Huawei Cloud AK/SK User settings → Credentials → Cloud platform credentials When using SRE cloud resource capabilities
CodeArts CLI / CodeArts engine execution CodeArts credentials User settings → Credentials → CodeArts When using the CodeArts engine
Platform object storage uploads Server-side OBS_* configuration Operations environment variables Configured by platform operations; does not use user credentials

How the three paths differ:

Path What it uses What it controls Where it is configured
Huawei account OAuth AGC / HUAWEI ID User sign-in to Grape Admin → Sign-in channels
Huawei Cloud AK/SK huawei_cloud credentials AI DevSpace, DevBridge, SRE, and other cloud resource operations User settings → Credentials → Cloud platform credentials
CodeArts credentials codearts credentials CodeArts CLI / engine execution User settings → Credentials → CodeArts

Integration steps

Step 1: Set up Huawei account OAuth

Use this when users should sign in to Grape with a Huawei account.

  1. Create an OAuth application in the AGC console and register the callback URL:

text https://<your-domain>/api/auth/callback/huawei

  1. Confirm that configs/oauth-providers.json contains a huawei channel card. The channel endpoints, scope, and field mapping are defined in that file; client_id / client_secret are not written into it.
  2. Enter the Huawei OAuth client_id and client_secret in Admin → Login channels, then save; they are encrypted before being stored.
  3. Verify the channel configuration:
Item Requirement
redirect_uri Byte-for-byte identical to the callback URL registered in AGC
user_url Keep the {access_token} query parameter placeholder; Huawei GOpen accepts query parameters only, not request headers
id_field / login_field Use openID; Huawei has no separate login name
pkce_enabled false; Huawei does not support PKCE
scope openid profile email
  1. Open the Grape sign-in page and confirm that the Huawei account entry appears; select it, complete authorization, and confirm that the redirect returns to sign-in.

Completion criteria: the sign-in page shows the Huawei entry, and after authorization the user returns to the Workbench with their identity displayed.

Step 2: Set up Huawei Cloud AK/SK

Use this for AI DevSpace, public DevBridge publishing, and SRE cloud resource operations.

  1. Sign in to the Huawei Cloud console, go to My credentials → Access keys, and create or retrieve the Access Key Id (AK) and Secret Access Key (SK).
  2. Confirm that the AK/SK has the required cloud resource permissions, and that the account has available AI DevSpace / CodeArts quota.
  3. Sign in to Grape and go to User settings → Credentials → Cloud platform credentials.
  4. Enter the AK and SK, then save.
  5. Check that the page only shows a mask, never the plaintext; the credential applies only to the current user.

Verification:

  1. Go to Runtime → AI DevSpace and create a device
  2. Confirm that the environment moves from creation to Running
  3. To verify SRE, also run a cloud resource query or deployment task

Completion criteria: AI DevSpace can be created and runs, or an SRE task can call cloud resources normally.

OBS is platform-side object storage. It uses server-side OBS_* environment variables and does not use the user's huawei_cloud credentials. For configuration, see Object storage and email.

Step 3: Set up CodeArts credentials

Use this when tasks run through the CodeArts CLI or the CodeArts engine.

  1. Obtain usable credentials on the CodeArts side (follow the credential instructions in the current CodeArts console or CLI).
  2. Sign in to Grape and go to User settings → Credentials → CodeArts.
  3. Enter the CodeArts credentials and save.
  4. Confirm that the provider is codearts; do not enter them under the Huawei Cloud AK/SK in Cloud platform credentials.
  5. Install codearts-cli, confirm that codearts --version runs, then run a real task.

Completion criteria: the CodeArts credentials are saved and the CodeArts engine can execute tasks.

Common confusions

Symptom Actual cause Action
Huawei account sign-in works, but creating a DevSpace reports a credential error Only OAuth was configured; no huawei_cloud AK/SK Add the AK/SK under User settings → Credentials → Cloud platform credentials
DevSpace can be created, but SRE deployment still fails Insufficient huawei_cloud permissions or an expired AK/SK Check the AK/SK permissions and validity period
The CodeArts engine reports that it is not configured Only huawei_cloud was configured; codearts was not Add CodeArts credentials separately
OBS upload fails The server-side OBS variables and the user cloud credentials are different configurations Check the server-side OBS_* variables

Do not include real AK/SK in documentation, logs, or screenshots; use placeholders in all examples.

Installation and startup | DevStage API | Object storage and email | Account registration and sign-in | Engine overview