1. Home
  2. FlexRule Server
  3. Integration
  4. Authenticate your Command

Authenticate your Command

◷ Reading Time: 2 minutes

Url

http://{your server address}/oauth2/token

Check Parameters for more information on parameters’ name and value.

 Only the HTTP POST method is valid for authorization.

Parameter

  • Header
    • Content-Type: application/x-www-form-urlencoded
  • Type:
    • grant_type: password

Ensure all parameters for application/x-www-form-urlencoded must be part of the request body.

For Application Accounts

  • client_id: [your client id account]
  • client_secret: [your client id account’s secret (password)]

For User Accounts

  • username: [your user login account]
  • password: [your user logic account’s secret (password)]

Result

The Server will return any data that has an access_token for your session.

 function (data) {
     var token = data.access_token;
 }

Example

POST http://localhost:9000/oauth2/token

grant_type=password&client_id=app1&client_secret=123456

Request

Below is the HTTP request configuration:

Response

Once the request is posted, you get the response shown below:

Updated on August 9, 2019

Was this article helpful?

Related Articles