âThe specified host (api.enterprise.apigee.com) is not present in the .netrc file.â
means the hostname is not present in your .netrc file. The .netrc file is just a way to provide credentials for the given host.
The following applies to Apigee Edge.
You can optionally tell the scanProxies.js tool to look in the .netrc file for credentials to use to authenticate to Apigee Edge. But if you want to use it, there should be a stanza like this in the file:
machine api.enterprise.apigee.com
login myusername@email.com
password VerySecret!
As an alternative, you can specify the username on the command line when you invoke the tool, like this:
node ./scanProxies.js -v -o schwarz-work -u myuser@email.com --policytype GenerateJWT
..and in that case the tool should prompt you for the password. If you like you can avoid the prompt, and specify the password also on the command line, like this:
node ./scanProxies.js -v -o schwarz-work -u myuser@email.com -p VerySecret --policytype GenerateJWT
If you have multi-factor OAuth, or SAML, or otherwise cannot use basic auth to authenticate to Apigee, then ⌠you will need to use a different approach to logging in. You can obtain a passcode from login.apigee.com/passcode, and specify it on the command line with the -C option:
node ./scanProxies.js -v -o schwarz-work -u myuser@email.com -C PASSCODEHERE --policytype GenerateJWT
Before trying any of that, you should get the latest version of the scanProxies tool from the apigee-edge-scanner repo. (git pull)
The following applies to Apigee X or hybrid
If you are connecting to Apigee X or hybrid, then you need to authenticate differently. It wonât work to use basic authentication. You can use the gcloud command to obtain an access token, then specify the token on the command line, though, like this:
TOKEN=$(gcloud auth print-access-token)
node ./scanProxies.js -v --apigeex -o schwarz-work --token $TOKEN --policytype GenerateJWT
EDIT: Iâve just updated this scanner tool so that it works with Apigee X or hybrid. Get the latest version.