nightscout / cgm-remote-monitor

nightscout web monitor
GNU Affero General Public License v3.0
2.42k stars 71.75k forks source link

Token/Role based access controls breaks OpenAps ns-upload-entries #1955

Closed PieterGit closed 8 years ago

PieterGit commented 8 years ago

can it be that pull Request nightscout/cgm-remote-monitor#1868 (Token/Role based access controls) caused the uploading of Dexcom cgm entries to fail with Nightscout@0.9.0-beta3

%ns-upload-entries cgm/cgm-glucose.json {"status":401,"message":"Unauthorized","description":"Invalid/Missing"}

And nightscout 0.9.0-dev shows DENIED

GRANTED: ::ffff:1.2.3.4 no-token api:entries:read default DENIED: ::ffff:1.2.3.4 no-token api:entries:create

I checked API_SECRET and TREATMENTS_AUTH=off

I would assume 0.9.0 does not cause uploading in OpenAps to fail.

jasoncalabrese commented 8 years ago

Are you still seeing a problem with this? If openaps is using your api-secret any requests should be authorized

PieterGit commented 8 years ago

I think it's solved. My custom ns-upload-entries still got a -H 'Authorization: Bearer header, but I think the token is not valid anymore and the uploading still works. will investigate later to confirm.

jasoncalabrese commented 8 years ago

Closing for now, reopen if you find a problem that looks like something on the NS side

cbruyndoncx commented 8 years ago

I'm getting the same denied message, I use the android medtronic uploader app and SandraK82 installation scripts for local rpi installation. I'm new at this, but I have some IT experience, and will digg a little bit further into the startup options to see if I can get some more detailed error info, or try with the other options to see if it makes a difference

jasoncalabrese commented 8 years ago

the old medtronic uploader doesn't send the api secret when posting to device status, the work around is setting the AUTH_DEFAULT_ROLES="readable devicestatus-upload" env var

tuzoenduro commented 5 years ago

@jasoncalabrese where do I set this up? I'm trying to upload carbs from a shortcut in IOS and keep getting this message.. thanks for the help

ondrejpelak commented 3 years ago

@tuzoenduro Hi, did you figure it out? I am trying to do the same thing... Not really smart from the documentation