colinlennon / xDripAPS

REST service designed to allow xDrip CGM data to be used in OpenAPS
13 stars 23 forks source link

xDripAPS does not support token based authentication of oref0 0.5.x #2

Open dramageek opened 7 years ago

dramageek commented 7 years ago

I believe that using token based auth for your nightscout site changes the API_SECRET variable, and breaks this tool.

PieterGit commented 7 years ago

I think whats needs to be done is change the logic of https://github.com/colinlennon/xDripAPS/blob/master/xDripAPS.py#L104-L117 If token based authentication is used, then the token is supplied at the end of the posting url, http://URL/endpoint?token=device-hash

So instead of checking for API_SECRET, you need to parse the token out of the calling URL and compare token=device-hash to the environment variable API_SECRET.

Please change the issue to: xDripAPS does not support token based authentication of oref0 0.5.x

kretep commented 5 years ago

This fixes the token-based authentication for me: https://github.com/colinlennon/xDripAPS/pull/7/commits/d8217e2be1d44f177b2fce44a5fb4cbe693495e2