Forum Discussion
NiHo_202842
Jul 03, 2017Cirrostratus
iControlREST: X-F5-Auth-Token does not exist
Hello, trying to commit a transaction programatically in Java. PATCH call to https://bigip.company.com/mgmt/tm/transaction/14990898300000?ver=12.1.2 with headers Content-Type: app...
Satoshi_Toyosa1
Jul 05, 2017Ret. Employee
If not timeout, then possibly copy & paste (or parsing) error. Run tcpdump to see if your program is sending a correct token.
If not parsing bug, then possibly you didn't get the token at all. Check the response status code and json data.
Try manually first as below.
Get a token:
curl -sk https://mgmtPort/mgmt/shared/authn/login -X POST -H "Content-Type: application/json" \
-d '{"username":"admin", "password":"secret", "loginProviderName":"tmos"}'
Output (abridged):
{"username":"admin",
...
"token": {
"token":"3YJFTKX4434X5ZZ7LGBPS5CAVA",
"name":"3YJFTKX4434X5ZZ7LGBPS5CAVA",
...
},
"timeout":1200, <<< seconds (=20 min)
"startTime":"2017-07-05T13:42:47.103+1200",
...
}
Use the token (let go, Luke):
curl -sk -H "X-F5-Auth-Token: 3YJFTKX4434X5ZZ7LGBPS5CAVA" \
https://mgmtPort/mgmt/tm/sys/version
When you've got a wrong token:
curl -sk -H "X-F5-Auth-Token: 3YJFTKX4434X5ZZ7LGBPS5CA" \ <<< forgot the last two chars.
https://mgmtPort/mgmt/tm/sys/version
Output
{"code":401,"message":"X-F5-Auth-Token does not xist.", ...}
You can check the available tokens on the system as below:
curl -sk -H "X-F5-Auth-Token: 3YJFTKX4434X5ZZ7LGBPS5CAVA" \
https://mgmtPort/mgmt/shared/authz/tokens | python -m json.tool | grep \"token\"
Output:
"token": "3YJFTKX4434X5ZZ7LGBPS5CAVA",
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects