1bin/magento config:set oauth/consumer/enable_integration_as_bearer 1For Apache insert the following code after basic auth code:
1SetEnvIf Request_URI /rest rest_url
2Order Allow,Deny
3Satisfy any
4<RequireAny>
5 Require env rest_url
6 Require valid-user
7</RequireAny>
For Nginx insert the following code after basic auth code:
1location /rest/ {
2 auth_basic off;
3 allow all;
4}