Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit e89c6e5

Browse files
authored
Merge pull request #156 from utkarsha-deriv/utkarsha/page-not-found
fix: broken link
2 parents d38b0c5 + 08b2ca5 commit e89c6e5

File tree

1 file changed

+24
-20
lines changed
  • docs/core-concepts/authorization-authentication

1 file changed

+24
-20
lines changed

docs/core-concepts/authorization-authentication/index.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ keywords:
1212
- deriv-authorization
1313
description: deriv api authentication and authorization
1414
---
15+
1516
Without authentication and authorization you'll only get access to roughly half of our API calls and features. for example in order to buy contracts or utilize the `Copy Trading` features your users must be authenticated and authorized by our **OAuth** provider and **Websocket Server**.
1617

1718
## Before we start
@@ -20,12 +21,12 @@ You have to make sure you have all the requirements mentioned bellow to continue
2021

2122
### Requirements
2223

23-
1. Deriv Account
24+
1. Deriv Account
2425
2. Deriv API Token with the appropriate access level
25-
3. Deriv App ID
26+
3. Deriv App ID
2627

2728
:::note
28-
Please refer to [Setting up a Deriv Application](docs/setting-up-a-deriv-application) for detailed instruction how to create Deriv API token and Applications
29+
Please refer to [Setting up a Deriv Application](/docs/setting-up-a-deriv-application.md) for detailed instruction how to create Deriv API token and Applications
2930
:::
3031

3132
### API Token
@@ -54,15 +55,13 @@ For more information on OAuth2, visit [this guide](https://aaronparecki.com/oau
5455

5556
Here is the visual representation of how the OAuth authorization connection works:
5657

57-
![OAuth flow](/img/how_oauth_works.png "OAuth flow")
58+
![OAuth flow](/img/how_oauth_works.png 'OAuth flow')
5859

5960
## Authentication Process
6061

6162
In order to Authenticate your user, specify the URL that will be used as the OAuth Redirect URL on the [Dashboard](/dashboard) page, **Register application** tab in the **OAuth details** fields and then Add a login button on your website or app and direct users to **`https://oauth.binary.com/oauth2/authorize?app_id=your_app_id`** where your_app_id is the ID of your app.
6263

63-
64-
65-
![Deriv OAuth Login](/img/oauth_login.png "Deriv OAuth Login")
64+
![Deriv OAuth Login](/img/oauth_login.png 'Deriv OAuth Login')
6665

6766
Once a user signs up / signs in, they will be redirected to the URL that you entered as the Redirect URL. This URL will have arguments added to it with the user's session tokens, and will look similar to this:
6867

@@ -71,28 +70,32 @@ Once a user signs up / signs in, they will be redirected to the URL that you ent
7170
## Authorization Process
7271

7372
The query params in the redirect URL are the user's accounts and their related session tokens. you can map the query params to an array like so:
73+
7474
```js
7575
const user_accounts = [
76-
{
77-
account: "cr799393",
78-
token: "a1-f7pnteezo4jzhpxclctizt27hyeot",
79-
currency: "usd"
80-
},
81-
{
82-
account: "vrtc1859315",
83-
token: "a1clwe3vfuuus5kraceykdsoqm4snfq",
84-
currency: "usd"
85-
},
86-
]
76+
{
77+
account: 'cr799393',
78+
token: 'a1-f7pnteezo4jzhpxclctizt27hyeot',
79+
currency: 'usd',
80+
},
81+
{
82+
account: 'vrtc1859315',
83+
token: 'a1clwe3vfuuus5kraceykdsoqm4snfq',
84+
currency: 'usd',
85+
},
86+
];
8787
```
88-
To authorize the user, based on the user's **Selected** account, call the [authorize](https://api.deriv.com/api-explorer#authorize) API call with the user's **Selected** account **Session Token**:
88+
89+
To authorize the user, based on the user's **Selected** account, call the [authorize](https://api.deriv.com/api-explorer#authorize) API call with the user's **Selected** account **Session Token**:
90+
8991
```js
9092
{
9193
"authorize": "a1-f7pnteezo4jzhpxclctizt27hyeot"
9294
}
9395
```
9496

9597
The response for the `authorize` call would be an object like so:
98+
9699
```js
97100
{
98101
"account_list": [
@@ -146,4 +149,5 @@ The response for the `authorize` call would be an object like so:
146149
"user_id": 12345678
147150
}
148151
```
149-
Now user is authorized and you use Deriv API calls on behalf of the account.
152+
153+
Now user is authorized and you use Deriv API calls on behalf of the account.

0 commit comments

Comments
 (0)