Перейти к основному содержимому

Первичная аутентификация

Смысл первичной аутентификации заключается в получении списка customers, связанного с учетной записью пользователя.

endpoint/auth/oauth/token
Параметры строки запроса / Query String Parametersgrant_type=Password
user_type=customer
username={encoded username} <-- шифруется с использованием public key
password={encoded password} <-- шифруется с использованием public key
Request methodPOST
Response status200

Дополнительные заголовки / Additional headers

Content-Typeapplication/json
AuthorizationBasic V0VCOg==

Ответ / Response object

ПолеТип данныхПримечание
1access_tokenstringJWT
2token_typestring"bearer"
3refresh_tokenstringJWT
4expires_inlong
5scopestring"ALL"
6passed_auth_factorsarray[]
7customer_external_idstring
8chain_typestring
9rolestring
10createddatetime"YYYY-MM-DDTHH:mm:ss.ff"
11role_versionlong
12cus_unique_idnstring
13is_password_changebooleanfalse
14sign_level
15roles_auth_factorsarray
16auth_factor_chainarray[]
17roleobject
18id
19code
20user_typestring"customer"
21suggest_add_deviceboolean
22user_idlong
23role_idlong
24bank_branch_code
25decrypted_username
26can_skipbooleantrue
27is_device_trustedboolean
28otp_strategy
29possible_chainsarray[]
30customer_user_idlong
31customersarray of objectsОписание customer в таблице далее
32customer_idlong
33digital_signature_typestring
34Jtistringuuid

Полученные данные обрабатываются на фронте и далее инициируется переход на главную страницу.

Customer object

ПолеТип данныхПримечание
1idlongИдентификатор для customer в системе
2namestringНазвание customer в системе

Пример запроса

curl 'https://api-test.berekebank.kz/auth/oauth/token?grant_type=Password&user_type=customer&username=[]&password=[] \ -H 'Accept: */*' \ -H 'Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7' \ -H 'Authorization: Basic V0VCOg==' \ -H 'Cache-Control: no-cache' \ -H 'Connection: keep-alive' \ -H 'Content-Type: application/json' \ -b '_ga=GA1.1.1456558304.1751004759; AMP_MKTG_37a989b454=JTdCJTdE; AMP_37a989b454=... (cookies truncated for brevity) ...' \ -H 'Device-Fingerprint:' \ -H 'Origin: https://api-test.berekebank.kz' \ -H 'Pragma: no-cache' \ -H 'Referer: https://api-test.berekebank.kz/customer/login' \ -H 'Sec-Fetch-Dest: empty' \ -H 'Sec-Fetch-Mode: cors' \ -H 'Sec-Fetch-Site: same-origin' \ -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36' \ -H 'sec-ch-ua: "Google Chrome";v="137", "Chromium";v="137", "Not/A)Brand";v="24"' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'sec-ch-ua-platform: "Windows"' \ --data-raw '{}'

Пример ответа

{"access_token":"","expires_in":899,"scope":"ALL","passed_auth_factors":[],"customer_external_id":null,"chain_type":"EMPTY","role":"ANONYMOUS","created":"2025-02-17T16:39:46.054","role_version":0,"cus_unique_idn":"111111111111","is_password_change":false,"sign_level":null,"roles_auth_factors":[],"user_type":"customer","suggest_add_device":false,"user_id":111111111111,"role_id":0,"bank_branch_code":null,"decrypted_username":"test","can_skip":false,"is_device_trusted":false,"otp_strategy":"UNDEFINED","possible_chains":[],"customer_user_id":0,"customers":[{"id":111111,"name":"ТОО \test\""},{"id":111111,"name":"Test"},{"id":111111,"name":"ИП Test."},{"id":111111,"name":"АО Test"},{"id":111111,"name":"Test"},{"id":111111,"name":"ИП Test"},{"id":111111,"name":"ТОО Test тест тест тест тест тест тест тест тест "},{"id":111111,"name":"АО Test"},{"id":111111,"name":"ТОО Test"},{"id":111111,"name":"ИП Test"},{"id":111111,"name":"ИП test"}],"customer_id":null,"digital_signature_type":null,"jti":"74531e41-0560-49b5-a2f8-def49731d390"}