You can use the Basic auth policy to protect HTTP Request flows with basic access authentication. Then, if someone sends a request to the flow, they must include a username and password in the HTTP headers of the request. If they don't, the request will be rejected.
This topic explains how to create and use a Basic auth policy.
- Open a project.
- In the sidebar, click Auth policies.
- Click Add auth policy.
- In the Auth Policy Name field, enter a name for the policy.
- Select Auth Policy Type > Basic.
- In the Username field, enter a username.
- In the Password field, enter a password.
- Click Save.
- In an HTTP Request flow, open the Start (HTTP Request) component.
- From the Authentication dropdown, select the auth policy.
- Close the component's settings.
- Click Save.
Click the Run button.
The request should fail and the following error should appear in the Output tab:
Failed to pass auth policy. StatusCode: 401 Message: A Basic Authentication should be provided.
This confirms that the auth policy is enabled.
Convert the auth policy's credentials into a base64-encoded string. (This is a requirement of basic access authentication, not FL0.)
Concatenate the credentials into a colon-separated string:
Use base64encode.org (or a similar tool) to encode the string:
In the Input tab, create an
Set the value of the
Basic, followed by the encoded credentials:
This time, the request should succeed.
Updated 8 months ago