Forum Discussion
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: application/json ,
X-F5-Auth-Token: MMY23WRDKEBWIHXVJXMEFJEGF ,
and payload
{"state":"VALIDATING"}
returned code 401 with response
{"code":401,"message":"X-F5-Auth-Token does not exist."...}
Any ideas? I can start a transaction and add actions fine.
- ekaleidoCirrus
The auth token expires every 20 minutes. Are you sure you're not sending an expired token?
- NiHo_202842Cirrostratus
Hi ekaleido, I am running the code immediately after program startup so a fresh one is requested. I don't think it's because of a token timeout.
- ekaleido_26616Cirrocumulus
The auth token expires every 20 minutes. Are you sure you're not sending an expired token?
- NiHo_202842Cirrostratus
Hi ekaleido, I am running the code immediately after program startup so a fresh one is requested. I don't think it's because of a token timeout.
- Satoshi_Toyosa1Ret. 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",
- Satoshi_Toyosa1Ret. Employee
Can you run a simple iControl REST request (such as getting
) using the token? Also, double check if the token really exists (/mgmt/tm/sys/version
) immediately after you got/mgmt/shared/authz/tokens
error. If the token works for non-transaction requests and exists, then something odd going on in transaction: in that case, I suggest you to contact F5 Support for thorough analysis.X-F5-Auth-Token does not exist
Recent Discussions
Related Content
* 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