C7 Lightweight Agent Workbench Page OAuth 2.0 Interface Authentication
Description
This interface is used to perform OAuth 2.0 authentication on the lightweight agent workbench page. When this interface is invoked, the request must contain the authorization code, refresh token, and client ID.
Interface Method
This interface supports only the POST method.
URI
https://Domain name/apiaccess/CC-Management/v1/oauth/token. (For example, the domain name is service.besclouds.com.)
Request
- Message header
Table 1 Parameter in the message header No.
Parameter
Type
Mandatory
Description
1
Content-Type
String
Yes
Coding mode of the message body. The default value is application/json; charset=UTF-8.
- Message body
Table 2 Parameters in the message body No.
Parameter
Type
Mandatory
Description
1
grant_type
String
Yes
Authorization type
- authorization_code
- refresh_token
2
client_id
String
Yes
Client ID
3
client_secret
String
No
Client secret
This parameter is mandatory when grant_type is set to authorization_code.
4
code
String
No
Authorization code
This parameter is mandatory when grant_type is set to authorization_code.
5
redirect_uri
String
No
URL of the third-party application to be accessed
This parameter is mandatory when grant_type is set to authorization_code.
6
refresh_token
String
No
Refresh token
This parameter is mandatory when grant_type is set to refresh_token.
Response
|
No. |
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|---|
|
1 |
result |
Object |
No |
Result content object. For details about the parameters of this object, see Table 4. |
|
2 |
returnCode |
String |
Yes |
Error code. The options are as follows:
|
|
3 |
returnDesc |
String |
True |
Response message. |
|
No. |
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|---|
|
1.1 |
access_token |
String |
Yes |
Authentication token |
|
1.2 |
token_type |
String |
Yes |
Token type The default value is Bearer. |
|
1.3 |
expires_in |
Integer |
Yes |
Token validity period, in seconds. The default value is 3600. If the error code is not 0, no value is returned. |
|
1.4 |
refresh_token |
String |
Yes |
Refresh token |
|
1.5 |
scope |
String |
Yes |
Fixed read |
Example
- Message header
Content-Type:application/json; charset=UTF-8
- Request parameter
{ "grant_type": "authorization_code", "client_id": "A32135A8293289C5AFD5F9CAAD4CE9E5", "client_secret": "kt6D8aLI9ryfcisc", "code": "nJ8QI9", "redirect_uri": "https://www.baidu.com" } - Response parameter
{ "result": { "access_token": "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJBSUNDIiwic3ViIjoiMTcyNTYxMjY2ODk4NzEwOTE0NyIsInRlbmFudElkIjoiMjAyNDA4MDUwOTI1IiwiYXVkIjpbIkEzMjEzNUE4MjkzMjg5QzVBRkQ1RjlDQUFENENFOUU1Il0sImlhdCI6MTc0ODI0MzM5MSwiZXhwIjoxNzQ4MjQ2OTkxLCJqdGkiOiJlNjUyMzg1NS1mZmZkLTRhZTItOWE4NS01NWQwZDUwNTZlOTEifQ.Irw5TF_7LQIy9vCL7BmoZSqrWKkM5XDrZ897N0D8PMH2b3z3dHiKrzOB1H6O86ombADn4uWzrNL2715boDOVu4YRIIjqQHUVkmQH2_whT5xg00eIN4sDgfGkWM_x3FY5Ia_DqV24tZt6IowSUNUo3NMiq_426Af7rUaroHvuqJX-PqDg2LdpetPIYR3XR9WuMmkuybFk4zwcLH_dT3nN0LhPT1q3ABNXnxiSpFVGbDqyOLjQukIs4q0HGWhXQOdM6O5Bs6pzI3psATijBbhaQdQugqVfVZNPuRNRstaE6JJ9SCDeLGtGKrKCt0GAulIDs_cfUOyH47v_G2Gbi4y-iQ", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "864ff2a5-02b0-4a7d-b085-84d76fc8ad8d", "scope": "read" }, "returnCode": "0", "returnDesc": "success" }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot