If you need to obtain
OAuth access data from authentication provider (Microsoft, Facebook, etc.), you can utilize HttpMaster support for obtaining it. Window for obtaining OAuth access data can be opened with the
Obtain OAuth Access Data toolbar button in the following places:
- Main application window; note that the button is only available if some project is open in HttpMaster.
- Request window.
- Execution window.
- Curl window.
Authorization data
The following data must be provided to successfully obtain OAuth access data:
- Authorization URL; authorization URL address of authentication provider; can contain optional query string with additional authorization parameters like 'response_type, 'scope', etc.
- Client id; client id provided by authentication provider.
- Client secret; client secret provided by authentication provider.
- Redirect URL; URL address to which authentication provider should redirect after user successfully authenticates and gives necessary permissions. This address must exactly match redirect URL specified with authentication provider.
- URL to exchange authorization code for tokens; URL address provided by authentication provider where obtained authorization code can be exchanged for tokens.
Obtaining OAuth access data
To obtain OAuth access data, click the corresponding button. Login page will be displayed where you will have to log in and give necessary permissions. If OAuth access data was successfully obtained, it will be displayed at the bottom of the window. You can copy the desired data to Clipboard or click
OK button to temporarily stored them in currently open project (note that stored OAuth access data is lost when the project is closed).
Using obtained OAuth access data
If you have stored OAuth access data in currently open project (see previous section), you can include it in every request item that belongs to the project. Data can be used in:
- Request item URL.
- Request item body.
- Request item header.
To use obtained authorization code, utilize global variable
hm-authorization-code in any of the relevant request item properties. To use obtained access token, utilize global variable
hm-access-token in any of the relevant request item properties. To use obtained refresh token, utilize global variable
hm-refresh-token in any of the relevant request item properties. All variables must be enclosed in curly braces when used.
During the execution, all occurrences of the variable will be replaced with the obtained OAuth value.
For a step by step tutorial for obtaining OAuth access data, see the
corresponding topic in
How to section.