# Kullanıcı Doğrulama
## OAuth2 Web Doğrulama Süreci
Kullanıcı web sitesi üzerinden kullanıcı doğrulama talebini iletir.
Web sitesi https://account.burgan.com.tr/authorize adresine kullanıcı girişi için kullanıcıyı yönlendirir.
### Authorize Request
>**account.burgan.com.tr/authorize?**
>>response_type=**code**&
>>scope=**Uğur&**
>>state=**df485b78**
>>redirect_uri=**https%3A//ebank.burgan.com.tr/authorized&**
>>client_id=**burgan_web_ib**
>>code_challenge: **8b325a4db34d470525a0f48e97dbc0e0...&**
>>code_challenge_method: **S256**
### Authorize Response
Doğrulama süreci sonrasında IDM direkt olarak authorization code ile uygulamayı geri çağırır.
>HTTP/1.1 302 Found
Location: https://ebank.burgan.com.tr/authorized?code=**SplxlOBeZQQYbYS6WxSbIA**&state=**df485b78**
### Get Token with Authorization Code
Sonrasın uygulama elindeki code ile tokenları alır.
Aldığı tokenlar üzerinden API çağrımına uygun hale gelir.
#### Request
>**POST account.burgan.com.tr/token**
>>code=**SplxlOBeZQQYbYS6WxSbIA&**
>>grant_type=**authorization_code&**
>>client_id=**burgan_web_ib**
>>code_verifier: karatas2323,
>>redirect_uri=**https%3A//ebank.burgan.com.tr/token&**
#### Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"2YotnFZFEjr1zCsicMWpAA...",
"token_type":"Bearer",
"expires_in":3600,
"refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA..."
"identity_token":"dGfdffdsfs4e54fgsdfsdA..."
}
### Get Token with Refresh Token
#### Request
>**POST account.burgan.com.tr/token**
>>code=**SplxlOBeZQQYbYS6WxSbIA** ?????
>>grant_type=**refresh_token**
>>refresh_token=**tGzv3JOkF0XG5Qx2TlKWIA...**
>>client_id=**burgan_web_ib**
#### Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"2YotnFZFEjr1zCsicMWpAA...",
"token_type":"Bearer",
"expires_in":3600,
}
## Native Login / Mobile Doğrulama Süreci
Doğrulama süreci oAuth2 benzeri şekilde ilerler. Doğrulam sonucunda Authorization code elde edilir ve o kod ile OAuth2 Token alınarak süreç devam eder.
curl --request POST \
--url 'account.burgan.com.tr/oauth/token' \
--header 'content-type: application/x-www-form-urlencoded' \
--data grant_type=password \
--data username=3855206900 \
--data password=......... \
--data client_id=ib-mobile \
--data client_secret=YOUR_CLIENT_SECRET \
--data code_challenge: **8b325a4db34d470525a0f48e97dbc0e0...&**
--data code_challenge_method: **S256**
:::warning
Detaylar **Flow** içerisinde değerlendirilecektir.
:::