Integration
Summary
Debank Connect is based on the OAuth2.0 authorization standard protocol. With DeBank Connect, enable Web3 users to effortlessly sign in your Dapp via DeBank. Once they grant authorization, access their account name/avatar, on-chain portfolio data, and social following data.
Create App
Create and Verify App
Log in to Official dashboard, click the Apps tab on the navbar, and click Create New App.
Once you have finished creating the App, follow the instructions to complete the validation of the App.
Create Client
Click "Create Client"
After the creation, save the Client ID and Client Secret for subsequent Integration.
Integration
DeBank Connect currently only supports OAuth 2.0 Authorization Code Grant.
OAuth 2.0 Authorization Code Grant:
The DAPP guides the user to the DeBank Connect authorization page
Example of Authorization Redirect URL:
Description of DeBank Connect Authorization Page URL Parameters
Paramater | Requierd | Description |
---|---|---|
client_id | Yes | Third party identification credentials |
redirect_uri | Yes | After the authorization process is complete, it redirects to the dapp with the code. |
scope | No | The required scope of access for dApp application. |
response_type | No | Authorization code grant mode, default is "code". |
state | No, Recommed | If this parameter is included in the request, the authentication server will return it exactly as it is during the redirection, in order to prevent replay attacks. |
Scope | |
---|---|
user:base:read | User base info |
user:chain:read | User on-chain portfolio data |
user:social:read | User social info |
The user can decide whether to authorize the Web service application. If authorization is not agreed, the process terminates. If authorization is agreed, the authorization endpoint is triggered. Then redirect to the "redirect_uri"
Example of redirect uri:
Paramater | Required | Description |
---|---|---|
code | Yes | Authorization code. After the user grants authorization, DeBank connect will redirect to the dApp with the code. |
state | No, Recommed | If this parameter is included in the request, the authentication server will return it exactly as it is during the redirection, in order to prevent replay attacks. |
The dApp server side obtains access token and refresh token through authorization code.
DeBankConnect API for access token and refresh_token.
Paramater | Required | Description |
---|---|---|
code | Yes | Authorization code |
redirect_uri | Yes | The link for the redirection when the user is authorized, must be consistent. |
grant_type | Yes | Authorization code mode, default is "authorization_code". |
Response:
Paramater | Required | Description |
---|---|---|
access_token | Yes | Access Token |
expires_in | Yes | Expire time |
refresh_token | Yes | Refresh Token |
scope | Yes | The required scope of access for dApp application |
token_type | Yes | The authentication method for the access token. |
Example:
The DAPP service refreshes the access_token by refresh_token.
Paramater | Required | Description |
---|---|---|
refresh_token | Yes | Refresh Token |
grant_type | Yes | Authorization code mode, default is "refresh_token". |
Response:
Paramater | Required | Description |
---|---|---|
access_token | Yes | Access Token |
expires_in | Yes | Expire time |
refresh_token | Yes | Refresh Token |
scope | Yes | The required scope of access for dApp application |
token_type | Yes | The authentication method for the access token. |
Example:
Accessible API list
scope | Link |
---|---|
user:base:read | |
user:chain:read | |
user:social:read |
Last updated