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.
- Create an OAuth application in the AGC console and register the callback URL:
text
https://<your-domain>/api/auth/callback/huawei
- Confirm that
configs/oauth-providers.jsoncontains ahuaweichannel card. The channel endpoints, scope, and field mapping are defined in that file;client_id/client_secretare not written into it. - Enter the Huawei OAuth
client_idandclient_secretin Admin → Login channels, then save; they are encrypted before being stored. - 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 |
- 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.
- 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).
- Confirm that the AK/SK has the required cloud resource permissions, and that the account has available AI DevSpace / CodeArts quota.
- Sign in to Grape and go to User settings → Credentials → Cloud platform credentials.
- Enter the AK and SK, then save.
- Check that the page only shows a mask, never the plaintext; the credential applies only to the current user.
Verification:
- Go to Runtime → AI DevSpace and create a device
- Confirm that the environment moves from creation to Running
- 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'shuawei_cloudcredentials. 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.
- Obtain usable credentials on the CodeArts side (follow the credential instructions in the current CodeArts console or CLI).
- Sign in to Grape and go to User settings → Credentials → CodeArts.
- Enter the CodeArts credentials and save.
- Confirm that the provider is
codearts; do not enter them under the Huawei Cloud AK/SK in Cloud platform credentials. - Install
codearts-cli, confirm thatcodearts --versionruns, 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.
Related
Installation and startup | DevStage API | Object storage and email | Account registration and sign-in | Engine overview