I accept that the image is of Apigility, but should I expect similar from API Tools?
I set up a api-tools-skeleton, added the laminas-api-tools/api-tools-documentation-swagger library and created a service with using the basic authentication.
At this stage, should I expected the ‘Authorization’ field to be accessible in the swagger documentation or how to I get it to work?
As far as I can tell from your screenshots, you have created a Basic Auth Adapter basictest (basic). Have you created and stored the corresponding htpasswd file for your Basic Auth Adapter as described here?
If so, you can define the authorization header with a combination of username and password of one of the mentioned users in the htpasswd file.
Example header: Authorization: Basic <base64 encoded credentials>.
The RFC 7617 says basic auth the credentials have to be simply base64 encoded. Just concatenate username and password with a “:” and encode it.
$authentication = "Basic " . base64_encode($username . ':' . $password);
Add the resulting string to the swagger authorization header value.
I had set up the basic auth adapter as per the docs, I just don’t understand what I need to do to get the Authorisation text field to appear in the first screenshot.