User token unauthorized

Gabriele6 years ago

Hi everyone,

First of all, I apologise if this question has been asked earlier but I couldn't find any evidence on the forum (maybe my crawling is bad).

I am currently developing an Android app for viewing a device linked to a specific user on my traccar instance.

The user scans a qr code which contains the user's token. I get a correct answer from /api/session.

After that call, I want to know the device linked to the user. I got a userId from the previous api call, so I call /api/devices with all=false and the given userId, but the server answers with "Authentication Failed".

Can someone point me in the right direction? How can I authenticate just by using the token?

Thank you for the help

Gabriele

Anton Tananaev6 years ago

Are you including session cookie in the request?

Gabriele6 years ago

Ok thanks... and sorry for the dumb question. I didn't include the session cookie.

Thank you for the reply and for Traccar!