Follow

Managing Authentication in API Test Maker

The Manage API Authentication page allows you to create and manage API Keys, Basic Auth, and OAuth credentials for your API tests.

Authentication.png

The following video provides a brief introduction to managing API keys and basic auth in API Test Maker.

Manage API Keys

An API Key is a key/value pair that is passed to the API to provide access control and authenticate an API request. If you are attempting to test an API that requires an API Key, you can define the key in the Manage API Authentication page. Once you define an API Key in API Test Maker, you can then assign that key to a specific API model so that the assigned key is used for all of the tests that you generate for that model.

Note: Changes to API Keys that are located in the request header are applied to your tests at the time of execution. If you make changes to a header API Key, your changes are automatically applied to your tests the next time that you execute them. Changes to API Keys that are located in the query are applied to your tests at the time of test generation. If you make changes to a query API key, you must regenerate your tests to have the changes applied.

Create a New API Key

  1. Click Manage API Authentication in the menu bar at the top of the page.
    The Manage API Authentication page opens.
  2. Enter a brief description for the API key in the Description field.
    The description displays in a list of available API keys when you assign an API key to an API model. Ensure that it is descriptive enough to identify the desired key. The description value must also be unique.
  3. Enter the key name in the Name field.
    Typical values include api_key, apikey, key, or something similar. You must obtain the exact value from the API that you want to connect to.
  4. Enter the key value in the Value field.
  5. Select one of the following values from the In column:
    • Header: Places the API key in the request header.
    • Query: Places the API key as a parameter in the query.
  6. Click Save.
    Your API key is saved and available from the API Key list at the top of the Edit API Tests page for your model.

Modify an Existing API Key

  1. Click Manage API Authentication in the menu bar at the top of the page.
  2. The Manage API Authentication page opens.

  3. Make the desired changes to the API key description, name, or value.
  4. Click Save.
  5. To delete an API key:
    1. Click Delete ParameterDeleteIcon.png next to the API key that you want to delete.
    2. Click OK in the confirmation window.

Note: Deleting an API key that is currently assigned to a model removes the API key from the model. A confirmation window indicates the number of models that are currently using this API key. 

Assign an API Key to a Model

  1. Click Manage API Authentication in the menu bar at the top of the page.
    The Manage API Test page opens.
  2. Click the Name of the API model that you want to update.
    The Edit API Tests page opens. 
  3. Select the API Key that you want to apply to the model from the API Key list at the top of the page.
    The selected API key is applied to the model and is used for all of the tests that you generate from the model.

Manage Basic Auth

HTTP Basic Authentication (Basic Auth) lets you specify your credentials to your API by sending a user name and password to the API. You can provide Basic Auth only for a test, or you can provide both Basic Auth and an API Key.

If you are attempting to test an API that requires Basic Auth, you can define the credentials in the Manage API Authentication page. Once you define Basic Auth in API Test Maker, you can then assign those credentials to a specific API model so that the credentials are used for all the tests that you generate for that model.

Note: The Basic Auth credentials are assigned to your tests at the time of execution. If you add or update the Basic Auth for a model with existing tests, the credentials are added to your tests the next time that you execute them. You don't have to regenerate the tests for your Basic Auth changes to take effect.

Create a Basic Auth

  1. Click Manage API Authentication in the menu bar at the top of the page.
    The Manage API Authentication page opens.
  2. Enter a brief description for the Basic Auth in the Description field.
    The description displays in a list of available Basic Auths when you assign a Basic Auth to an API model. Ensure that it is descriptive enough to identify the Basic Auth credentials. The description value must also be unique.
  3. Enter the user name in the User Name field.
  4. Enter the password value in the Password field.
  5. Click Save.
    Your Basic Auth credentials are saved and available from the Authentication list at the top of the Edit API Tests page for your model.

Modify an Existing Basic Auth

  1. Click Manage API Authentication in the menu bar at the top of the page.
  2. The Manage API Authorization page opens.

  3. Make the desired changes to the Basic Auth description, user name, or password.
  4. Click Save.
  5. To delete a Basic Auth:
    1. Click Delete ParameterDeleteIcon.png next to the Basic Auth that you want to delete.
    2. Click OK in the confirmation window.

Note: Deleting a Basic Auth that is currently assigned to a model removes the Basic Auth from the model. A confirmation window indicates the number of models that are currently using the selected credentials. 

Manage OAuth

OAuth (Open Authorization) is an open standard for token-based authentication to your API.

If you are attempting to test an API that requires OAuth, you can define the credentials in the Manage API Authentication page. Once you define OAuth in API Test Maker, you can then assign those credentials to a specific API model. When you execute tests from that model, API Test Maker passes a request with your client ID and client secret to the OAuth URL to obtain a token. That token is then added to the header of each generated test.

Note: The OAuth credentials are assigned to your tests at the time of execution. If you add or update the OAuth for a model with existing tests, the credentials are added to your tests the next time that you execute them. You don't have to regenerate the tests for your OAuth changes to take effect.

Create an OAuth

  1. Click Manage API Authentication in the menu bar at the top of the page.
    The Manage API Authentication page opens.
  2. Enter the OAuth token name in the Token Name field.
    The token name displays in a list of available OAuth credentials when you assign an OAuth to an API model. Ensure that it is descriptive enough to identify the OAuth credentials. The token name must also be unique and cannot be the same as an existing API Key or Basic Auth description.
  3. Enter your client identifier and secret in the Client ID and Client Secret fields.
  4. Enter the OAuth URL in the URL field.
    Note: client_credentials is selected by default and is currently the only supported grant type.
  5. Click Save.
    Your OAuth credentials are saved and available from the Authentication list at the top of the Edit API Tests page for your model.

Modify an Existing OAuth

  1. Click Manage API Authentication in the menu bar at the top of the page.
    The Manage API Authorization page opens.
  2. Make the desired changes to the OAuth credentials.
  3. Click Save.
  4. To delete OAuth credentials:
    1. Click Delete ParameterDeleteIcon.png next to the OAuth that you want to delete.
    2. Click OK in the confirmation window.

Note: Deleting an OAuth that is currently assigned to a model removes the OAuth from the model. A confirmation window indicates the number of models that are currently using the selected credentials. 

Assign Authentication to a Model

  1. Click Manage API Authentication in the menu bar at the top of the page.
    The Manage API Tests page opens.
  2. Click the Name of the API model that you want to update.
    The Edit API Tests page opens. 
  3. Select the Basic Auth  or OAuth that you want to apply to the model from the Authentication list at the top of the page.
    The selected credentials are applied to the model and are used for all the tests that you generate from the model.

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.