Hi All,
I am trying to use acurl and get_token utilities for calling management APIs. I have installed it on my system but when I run acurl -h command. I get following error
bash: acurl: command not found
Please note that I am using:
Windows 7,Git Bash.
Has anyone tried this on Windows machine or encountered similar issue??
Solved! Go to Solution.
Hi @Vipul Agarwal,
I understand that you're looking for acurl solution. But as an alternative, you could obtain a token calling Management API directly and use it for subsequent calls. Maybe this would help you get unstuck.
Here's the cURL command from get_token bash function:
curl -s -d "grant_type=password" --data-urlencode "username=$ae_username" --data-urlencode "password=$ae_password" https://login.apigee.com/oauth/token --header "Content-Type: application/x-www-form-urlencoded;charset=utf-8" -H "accept: application/json;charset=utf-8" -H "authorization: Basic ZWRnZWNsaTplZGdlY2xpc2VjcmV0"
If MFA is enabled. Pass token as query param mfa_token.
Please note that encoded credentials above are subject to change at anytime. So far, they've been pretty static.
Hope it helps!
Diego
Hi Vipul,
Currently get_token and acurl are not supported on Windows. But you can install win-bash (http://win-bash.sourceforge.net) or Cygwin (https://www.cygwin.com) as a workaround to run the get_token tool.
Thanks
Gopi
Is Git Bash an option instead of Cygwin? As far as I know Cygwin gives you a bash terminal to run on windows, and GitBash also does the same. I am using Git Bash.
That's right. I was able to run acurl and get_token from Git Bash .. just added the install directory to Win 7 path variable.
Hi Sushobhan,
How can we add add install directory to Win path. Please elaborate
I got stuck here in 4th step. https://docs.apigee.com/api-platform/system-administration/auth-tools#install
Windows Settings -> Edit System Environment Variables -> Advanced tab -> Environment Variables -> Select "Path" from the list of variables -> Edit ... -> Add the directory path.
Hi @Vipul Agarwal,
I understand that you're looking for acurl solution. But as an alternative, you could obtain a token calling Management API directly and use it for subsequent calls. Maybe this would help you get unstuck.
Here's the cURL command from get_token bash function:
curl -s -d "grant_type=password" --data-urlencode "username=$ae_username" --data-urlencode "password=$ae_password" https://login.apigee.com/oauth/token --header "Content-Type: application/x-www-form-urlencoded;charset=utf-8" -H "accept: application/json;charset=utf-8" -H "authorization: Basic ZWRnZWNsaTplZGdlY2xpc2VjcmV0"
If MFA is enabled. Pass token as query param mfa_token.
Please note that encoded credentials above are subject to change at anytime. So far, they've been pretty static.
Hope it helps!
Diego
@Diego Zuluaga I will try this and will come up with followup questions 😉
@Diego Zuluaga - what is ZWRnZWNsaTplZGdlY2xpc2VjcmV0?
@Ozan Seymen That's edgecli client with password grant used to exchange the token for the user.
Thanks for clarifying @gopi. Can it be assumed that these credentials won't or rarely change? Users leveraging acurl, Maven or any build tools that obtain a token from Management API are currently hard-coding these.
Also for clarification purposes Docs recently released official documentation about it:
http://docs.apigee.com/api-services/content/using-oauth2-security-apigee-edge-management-api
User | Count |
---|---|
5 | |
2 | |
2 | |
1 | |
1 |