Applies to ReadyAPI 3.0, last modified on December 06, 2019

The Automated Token Script editor allows you to specify scripts that will be used to automate retrieval of OAuth 2.0 tokens. You specify Groovy automation scripts in the editor fields.

Add Fields

Click . ReadyAPI will add a new empty field.

Delete Fields

  1. Select the field you want to delete.

  2. Click .

  3. Confirm that you want to delete the selected field.

Check Syntax

The editor warns you when checking your scripts if the code syntax is incorrect:

Script Error warning

Possible Errors

Browser Error

The browser will display all the errors returned by the authorization server.

Sample Browser Error: Google

Click the image to enlarge it.

Validation Error

If some script cannot be validated for some reason, you will get an error message.

Note: The error message is just an assumption. The error may be elsewhere.
Validation Error

Click the image to enlarge it.

Successful Validation

If the script validation has completed without errors, an information dialog will appear.

Note: This does not mean the script has actually retrieved something successfully (the credentials may still be wrong, for example). This means the script can run and is not malformed. Always check for any errors in the browser, even if the validation is successful.
Script Validated

See Also

About Automating Token Retrieval
OAuth Automation Example
Automating Token Retrieval

Highlight search results