Start a Conversation

Solved!

Go to Solution

2100

May 24th, 2020 10:00

Can't obtain Authentication Token

Hi,

I've installed a DDVE (dd_version_release=7.2.0.5-653470) in a Lab.

Now I want to send REST API calls to the machine, but cant obtain Authentication Token

What I do first is (based on the docs) to request a Token by executing:

curl -k -X 'POST' --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "auth_info": {"username":"sysadmin", "password":"***" } }' 'https://:3009/rest/v1.0/auth'

The respond is:

{"service_status": {"code": 0, "link": [{"href": "/rest/v1.0/system", "rel": "related"}], "details": "success"}}

 

What I miss here is the Authentication Token, which I need to be able to perform further Rest-Api-Calls. 

Can someone help me please?

Regards

May 25th, 2020 13:00

Please, use the "-v" parameter:

curl -v -k -X 'POST' --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "auth_info": {"username":"sysadmin", "password":"***" } }' 'https://:3009/rest/v1.0/auth'

 

5 Posts

May 25th, 2020 13:00

Luiz, thanks, that's it (-v), I managed this today morning, but forgot to mention this here

November 14th, 2022 06:00

This absolutely does NOT work. not even close.   The API guide is wrong, all references to this are wrong.  None of the curl executions work, none of the python executions work.  So far no way to get x-auth-token.  Completely broken process or no one really uses the API.  

November 16th, 2022 11:00

Finally got something to actually work

curl -i -s -k -X POST -H  "Content-Type: application/json" -d @omviewcred.json https://yourservername/api/SessionService/Sessions 

 

curl -i -s -k -X POST -H  "Content-Type: application/json" -d @omviewcred.json https://yourservername/api/SessionService/Sessions -v |grep -P "X-Auth-Token" | awk '{print$2}'

 

 

cat omveiewcred.json

  {
"UserName": "omview_svc",
"Password": "mysecrutz2",
"SessionType": "API"
}

 

No Events found!

Top