登录授权
DeBox Authorized Login is a login system based on OAuth2.0 protocol standards.Details
GEThttps://app.debox.pro/oauth/authorize
In DeBox App,Click the link to jump to the authorization interface, and the user clicks or cancels at the interface. After the user allows authorization, the page will jump to the redirect url and bring Code & Userid & Source
Request Example:
https://app.debox.pro/oauth/authorize/?
app_id=ohpdAP9W55gyXeJ0&grant_type=authorization_code&scope=userinfo&response_type=code&
pay_info=loginTest&redirect_uri=https://docs.debox.pro/demo/a.html
Request Example:
https://app.debox.pro/oauth/authorize/?
app_id=ohpdAP9W55gyXeJ0&grant_type=authorization_code&scope=userinfo&response_type=code&
pay_info=loginTest&redirect_uri=https://docs.debox.pro/demo/a.html
Parameters
Query
redirect_uri
: String
Callback url after the authorization is successful. When the user clicks authorization, the App will return the code as a parameter to the url.must be whitelist url,go to config App Domain first
app_id
: String
App ID on Developer plateform
scope
: String
Authorization field : payment represents payment authorization and moment represents moment message authorization
grant_type
: String
Indicates that the authorization mode is the authorization code:authorization_code
GEThttps://open.debox.pro/openapi/oauth2/access_token
Once you have the code from Step 1, request the following link to get it access_token:
Request Example:
curl --location --request GET
https://open.debox.pro/openapi/oauth2/access_token?
grant_type=authorization_code&code=ZDY5ZTA......FRE5
&app_id=xxxxxx&app_secret=xxxxxx&user_id=xxxxxx
Request Example:
curl --location --request GET
https://open.debox.pro/openapi/oauth2/access_token?
grant_type=authorization_code&code=ZDY5ZTA......FRE5
&app_id=xxxxxx&app_secret=xxxxxx&user_id=xxxxxx
Parameters
Query
grant_type
: String
Indicates that the authorization mode is:authorization_code
code
: String
code from Step 1
app_id
: String
App ID on Developer plateform
app_secret
: String
App Secret on Developer plateform
user_id
: String
user_id from Step 1
Responses
200: OK
{
"code": 1,
"data": {
"access_token":
"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODgzOTQ4MDMsInN1YiI6IjEwMzA1O
CJ9.hbEt8JthQvo85iGkhUiPpTlcII4n3hgOYDErUDS9X2kkOnsNM27pAO_x9WP4KEE_33uFEd6GOgS
A51MlYZakb1",
"expires_in": 1,
"refresh_token": "MDBMOWYZYWYTZMRLYS01ODRHLWJKYTUTZGFIMMU1ZDEZNWM3",
"token_type": ""
},
"message": "success",
"success": true
}
401: Failed
{
"code": 401,
"message": "Bad Request",
"success": false
}
GEThttps://open.debox.pro/openapi/oauth2/refresh_token
Refresh access_token
Request Example:
curl --location --request GET
https://open.debox.pro/openapi/oauth2/refresh_token?
grant_type=refresh_token&refresh_token=YTNMYMZJZMY......ZTAH
&app_id=xxxxxx&app_secret=xxxxxx&user_id=xxxxxx
Request Example:
curl --location --request GET
https://open.debox.pro/openapi/oauth2/refresh_token?
grant_type=refresh_token&refresh_token=YTNMYMZJZMY......ZTAH
&app_id=xxxxxx&app_secret=xxxxxx&user_id=xxxxxx
Parameters
Query
grant_type
: String
Indicates that the authorization mode is:refresh_token
refresh_token
: String
refresh_token from Step 2
app_id
: String
App ID on Developer plateform
app_secret
: String
App Secret on Developer plateform
user_id
: String
user_id from Step 1
Responses
200: OK
{
"code": 1,
"data": {
"access_token":
"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODgzOTQ4MDMsInN1YiI6IjEwMzA1O
CJ9.hbEt8JthQvo85iGkhUiPpTlcII4n3hgOYDErUDS9X2kkOnsNM27pAO_x9WP4KEE_33uFEd6GOgS
A51MlYZakbg",
"expires_in": 1,
"refresh_token": "MDBMOWYZYWYTZMRLYS01ODRHLWJKYTUTZGFIMMU1ZDEZNWM3",
"token_type": ""
},
"message": "success",
"success": true
}
401: Failed
{
"code": 401,
"message": "Bad Request",
"success": false
}