API đăng nhập bằng Token
Last updated
Last updated
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.
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
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}})
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)