data-upstream / data-upstream-service-201902

0 stars 0 forks source link

Unauthorized error for /log_data.json endpoint #8

Closed alvinvoo closed 5 years ago

alvinvoo commented 5 years ago

name: Accessing /log_data.json gives 401 about: This is an existing issue even in https://alpha.data-upstream.ch


Describe the bug The frontend is actually sending the device_token as X-Access-Token and got the error response, but when I tried with the user's X-Access-Token, I got the same error response as well

{ "errors": [ "X-Access-Token is invalid." ] }

Screenshots (click to enlarge) image

afitterling commented 5 years ago

actually it should be by design. the old one is definately working. the new one should also. use the first device token!

afitterling commented 5 years ago

or we wait untilni come back. could check the python notebooks?

afitterling commented 5 years ago

i just checked https://alpha.data-upstream.ch/. it works! does your stream has data?

afitterling commented 5 years ago

need first device token and disable key rotation

alvinvoo commented 5 years ago

devices with key rotation 'on' will need to have their device access token ' consumed in order' every time a request, i.e. POST or GET request is done on /log_data.json

The device access token has to be consumed from the first one on-wards. The index for the next available token is the one right after last_used_key_sequence (which starts at -1 for new device).

This is a non issue.