# Authorization with Service Account

To use the vStorage APIs, users will use the client ID and the client secret keys to be authorized via the authorization server (<https://iamapis.vngcloud.vn/accounts-api/v2/auth/token>) using the OAuth2 method.

**Header**

> 'Authorization':'Basic Base64(clientID:clientSecret)'

**Request body**

> 'grant\_type':'client\_credentials'
>
> 'scope':'email'

**Response**

> 'token\_type':'bearer'\
> 'access\_token':'koxoQrfdAhCFIRl1Sy897kRuHcOlswcW'\
> 'expires\_in':7200

If the credentials are authorized, an **access\_token** will be returned. Users will use this **access\_token** to access resources from the resource server.

**Example:**

> curl -X POST '<https://iamapis.vngcloud.vn/accounts-api/v2/auth/token'\\>
> -H 'Content-Type: application/json'\
> -H 'Authorization: Basic ZGM3MTYxNTYtMjQwMi00MDg2LTliYWItZGU5OTIxODVlYjU1OmJhYjYzYTZmLWYzOGUtNDZmNC05NjIyLTYzNTQwNGQ4MDFlNQ=='\
> -d '{ "grant\_type": "client\_credentials", "scope":"email" }'
>
> {"token\_type":"Bearer","access\_token":"eyJhbGciOiJSUz......GWug","expires\_in":1800,"refresh\_expires\_in":0}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vngcloud.vn/vng-cloud-document/vstorage/object-storage/vstorage-hcm03/identity-and-access-management/managing-vstorage-access-account/service-account/authorization-with-service-account.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
