Minta token produk
client_credentials dengan client produk dari tim Duluin. Token dibutuhkan untuk pair key (dan boleh dikirim, opsional, di request lain).
- Server
- https://sso.duluin.com/api
Header
| Nama | Nilai | Keterangan |
|---|---|---|
| Content-Typewajib | application/json | Tipe body request. |
Body request
application/jsonwajib| Field | Tipe | Keterangan |
|---|---|---|
| client_idwajib | string | ID client produk Anda, dari tim Duluin. |
| client_secretwajib | string | Dari tim Duluin; simpan di env produk, jangan di browser. |
| grant_typewajib | string | Selalu client_credentials.= "client_credentials" |
Contoh body
{
"client_id": "9d3c0b1e-5f7a-4c2d-8e6b-1a2b3c4d5e6f",
"client_secret": "<CLIENT_SECRET>",
"grant_type": "client_credentials"
}Respons
Contoh kode
curl -X POST 'https://sso.duluin.com/api/users/oauth/token' \
-H 'Content-Type: application/json' \
-d '{
"client_id": "9d3c0b1e-5f7a-4c2d-8e6b-1a2b3c4d5e6f",
"client_secret": "<CLIENT_SECRET>",
"grant_type": "client_credentials"
}'