Forum Discussion
BIGIP V12.1.2 LTM REST API Authentication Issue - Token works locally but not Remotely
I am testing out the REST API interface on a LTM server which uses TACACS for authentication. Logged into the actual LTM server I can issue a request:
curl -sk --header "Content-Type: application/json" --data '{"username":"user","password":"password","loginProviderName":"tmos"}' --request POST https://127.0.0.1/mgmt/shared/authn/login
and get the TOKEN request back then submit a follow request to access the API ok example:
curl -sk --header "X-F5-Auth_Token: V2HGA4MXNWNRQ242DPT2A7HQCO" https://127.0.0.1/mgmt/tm/ltm/virtual
Now if I attempt to access the same LTM from a remote server - which does have access to port 443 on the mgmt server ip address, I can get the token ok but any subsequent request using the token provided results in a 401 error saying "Authentication Required" Example:
GET /mgmt/tm/ltm/virtual HTTP/1.1
User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2 Host: 172.30.239.3 Accept: / X-F5-Auth_Token: V2HGA4MXNWNRQ242DPT2A7HQCO
HTTP/1.1 401 F5 Authorization Required
Any idea why this works locally but NOT remotely??
I know this is super late, but I think the reason is that the header name in your example is "X-F5-Auth_Token", but the correct header name is "X-F5-Auth-Token".
- awlunsfo_325510Nimbostratus
I know this is super late, but I think the reason is that the header name in your example is "X-F5-Auth_Token", but the correct header name is "X-F5-Auth-Token".
- Neil_MarksNimbostratus
Yep - I have moved past this issue - and you are correct it's "X-F5-Auth-Token"...
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