Depending on the type of authentication or authorization required by your API, you can add auth settings at the test level and the request level for an API test. Mabl supports the following authentication types for API tests:
- API key
- Basic auth
- Bearer token
- OAuth 1.0
If you need support for additional authentication types, please let us know via the mabl Product Portal.
Test-level auth
To apply auth settings to all requests in an API test, take the following steps:
- Click on the "Edit test properties" pencil in the top-left corner of the API Test Editor.
- In the edit test modal, select the authentication method that the API requires.
- Enter auth details as required by the API.
- Close the edit test modal.
Adding test-level auth
Request-level auth
The default auth setting for all requests is "Use test-level auth." If the auth settings at the request level use a different method, the request-level auth settings will override the test-level auth settings.
To apply auth settings to a specific request in an API test, open the test in the API Test Editor and take the following steps:
- In the step builder for a given request, click on the Auth tab.
- Select the authentication method that the request requires.
- Enter auth details as required by the API.
Auth settings in Postman imports
If you imported a Postman collection with auth settings, check out this article to learn more about how auth settings are imported from Postman.