How-To Guides

How to Create and Use OAuth 2.0 Tokens in Litmus Edge

2min

You can create and use OAuth 2.0 tokens for accessing Litmus Edge APIs.

Generating an OAuth 2.0 Token in Litmus Edge

To create an OAuth 2.0 token:

  1. Navigate to System > Access Control > Tokens.
  2. Click on Add API Credentials.

    Tokens menu
    Tokens menu
    
  3. Select OAuth 2.0 Client as the type of credentials.

    API Credentials Pane
    API Credentials Pane
    
  4. Configure the following token settings:
    • Provide a Token Name.
    • Assign the token to appropriate RBAC (Role-Based Access Control) groups.
    • (Optional) Set an Expiration Date for the token.
    • Define the Access Token Lifespan in minutes.
    • Click Add.

      Add OAuth client dialog box
      Add OAuth client dialog box
      
  5. Litmus Edge will generate Client ID and Client Secret.
    • Copy and securely store the Client ID and Client Secret. These values are shown only once.

      Document image
      

Using OAuth 2.0 Token with Postman

To use OAuth 2.0 token with postman:

  1. Open Postman.
  2. Click New Request.

    Postman home
    Postman home
    
  3. Create a new request and select either GET or POST based on your needs.
  4. Navigate to the Authorization tab.
  5. Select OAuth 2.0 from the Auth Type dropdown.

    Postman > Authorization
    Postman > Authorization
    
  6. Under Configure New Token:
    • Token Name: Enter a name for this token configuration.
    • Grant Type: Select Client Credentials.
    • Access Token URL: Enter the token endpoint: https://<Litmus Edge URL>/api/v3/oauth/token.
    • Client ID: Enter the Client ID generated in Litmus Edge.
    • Client Secret: Enter the Client Secret generated in Litmus Edge.
    • Scope: Leave this field empty (if not required).
    • Client Authentication: Choose Send as Basic Auth header.

      Configure New Token tab
      Configure New Token tab
      
  7. Click on Get New Access Token:
    • Postman will retrieve the token and display it in the Access Token field.
  8. Add the Authorization Token to your request:
    • The token will be automatically added to the headers by Postman.
  9. Click Send to execute the API request.
  10. Verify the response from the server.