5 posts / 0 new
Last post
schup011
How to get API token from dexters-web.de

Hi, I tried to get an API token for an openhab integration with the command:

curl --location --request POST 'https://ovms.dexters-web.de:6869/api/token?username=MYUSER&password=MYPASSWORD'

I get only

Authentication failed.

But username and password are correct. What am I doing wrong?

Thanks a lot for your help!

 

Greypeter
How to get API token from dexters-web.de

Hi, I found that I had to use a backslash before the & like this:

curl --location --request POST 'https://ovms.dexters-web.de:6869/api/token\?username=MYUSER\&password=MYPASSWORD'

markwj
markwj's picture
You are using the linux / osx

Assuming you are using the linux / osx command line, you will need to 'escape' the & and ? characters if you use the double quote marks around the URL. Using single quote marks should avoid having to do that (so long as neither your username nor password have single quote marks in them).

You can add the '-v' flag to curl to show the details of request sent, and response received.

dexter
dexter's picture
How to get API token from dexters-web.de

My server still runs the old (V2) OVMS server code, haven't had the time to do the upgrade yet.

So token auth isn't supported yet, only cookie auth.

Sorry for the inconvenience.

Regards,
Michael

schup011
Thanks a lot and you don't

Thanks a lot and you don't have to apologize!!.

That explains the problems. I am now trying to implement cookie auth with the exec binding in openHAB with curl. Not so convenient, but it starts to work.

Log in or register to post comments
randomness