API đăng nhập bằng Token

Tổng quan

Trong tài liệu này, bạn sẽ tìm thấy thông tin chi tiết về cách chuẩn bị thông tin, tạo Token trên vCD portal, và tạo Bearer token.

Quy trình

1

Bước 1: Chuẩn bị thông tin

Đăng nhập vào IAM portal -> vCD portal: thu thập thông tin

  • {{vcd_url}}

  • {{tenant_name}}

Ex: https://iaas-hcmc02.higiocloud.vn/tenant/”tenant_name”/vdcs/dashboard

2

Bước 2: Tạo Token trên vCD portal

  • Đăng nhập vào IAM portal -> vCD portal -> User preferences

  • API tokens -> New

Sao chép token ({{api-token-generated}})

3

Bước 3: Tạo Bearer token

  • POST https://{{vcd_url}}/oauth/tenant/{{tenant_name}}/token

  • Authorization: No Auth

  • Headers:

- 'Accept: application/json'

- 'Content-Type: application/x-www-form-urlencoded'

  • Body:

raw: 'grant_type=refresh_token&refresh_token={{api-token-generated}}'

  • SEND request.

Response body: "access_token" (Bearer token)

Last updated