El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating OAuth Authorization

Updated on 2023-06-25 GMT+08:00

Function

This API is used to create OAuth authorization.

URI

POST /v1/{project_id}/git/auths/{repo_type}/oauth

Table 1 describes the parameters.

Table 1 Path parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Tenant's project ID.

repo_type

String

Yes

Repository type.

Value: github, gitlab, gitee, or bitbucket.

Table 2 Query parameters

Parameter

Type

Mandatory

Description

tag

String

No

Site tag.

Request

Request parameters

Table 3 Request parameters

Parameter

Type

Mandatory

Description

name

String

Yes

Authorization name.

code

String

Yes

Query parameter in the redirection URL after Git repository authorization is performed.

state

String

Yes

One-off authentication code and random string received after Git repository authorization is performed.

NOTE:

To obtain the values of code and state, perform the following steps:

  1. Enter the URL obtained in Obtaining an Authorization Redirection URL in the address box of the browser and press Enter.
  2. On the login page, enter your code repository account and password.

    If you have logged in to the code repository, skip this step.

  3. On the login page of the console, enter the account name and password, and click Log In.

    If you have logged in to the console, skip this step.

  4. After the system displays a message indicating that the authorization fails to be created, copy the URL in the address box. Example:

    https://console****.com/servicestage/oauth?repo_type=github&code=04bed2df009f3fc9***c&state=%242a%2410%24.uQYThj5yKFs51w9s9ajeuQ0NSGshPH7IUfXoZLPlz7J%2FoAJ8B***

  5. Decode the obtained URL to obtain the decoded URL. Example:

    https://console.****.com/servicestage/oauth?repo_type=github&code=04bed2df009f3fc9***c&state=$2a$10$.uQYThj5yKFs51w9s9ajeuQ0NSGshPH7IUfXoZLPlz7J/oAJ8B***

    Obtain the values of code and state.

The value of the obtained state is a one-off authentication code and random string, which can be used only once. If you need to call this API again to create OAuth authorization, follow the steps in Obtaining an Authorization Redirection URL again to obtain the URL and obtain the values of code and state.

Response

Response parameters

Table 4 Response parameters

Parameter

Type

Description

authorization

Object

Authorization structure. For details, see Table 5.

Table 5 authorization parameters

Parameter

Type

Description

name

String

Authorization name.

repo_type

String

Repository type.

Value: github, gitlab, gitee, or bitbucket.

repo_host

String

Repository address.

repo_home

String

Repository homepage.

repo_user

String

Repository username.

avartar

String

Avatar.

token_type

String

Authorization mode.

create_time

Long

Creation time.

update_time

Long

Update time.

status

Integer

Status.

Example

Example request

{
  "name": "string",
  "code": "string",
  "state": "string"
}

Example response

{
  "authorization": {
    "name": "string",
    "repo_type": "string",
    "repo_host": "string",
    "repo_home": "string",
    "repo_user": "string",
    "avartar": "string",
    "token_type": "string",
    "create_time": 0,
    "update_time": 0,
    "status": 0
  }
}

Status Code

Table 6 Status codes

Status Code

Description

200

OK

400

Bad Request

Error Code

Error code must be in the format of SVCSTG.REPO.[Error_ID]. Example: SVCSTG.REPO.0401. See ServiceStage Error Codes.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback