Delubear / GlucoseTray

Tray Icon for displaying current BG information in taskbar.
MIT License
35 stars 21 forks source link

Not working if herokuapp requires api secret #8

Closed JimZam closed 5 years ago

JimZam commented 5 years ago

Good evening. It's a great application, thank you so much for sharing. My problem is I have "AUTH_DEFAULT_ROLES denied" in heroku.com settings so the application doesn't work. I've tried creating a Subject with access token without luck (in herokuapp.com Admin Tools). Thank you so much for your help Regards

Delubear commented 5 years ago

Let me look and see how it would authenticate in this scenario. Expect an addition to the config file for supplying a secret most likely.

Delubear commented 5 years ago

Uploaded the ApiSecretSupport branch if you could download and compile that. You'll find the ApiSecret in the .exe.config file. Should be a matter of entering your ApiSecret there and testing it if it works. If you are able, please let me know your findings, so I can merge it into master if it works, or keep working on it.

I can also compile and upload the binaries should you need them.

Thanks!

Delubear commented 5 years ago

@JimZam

JimZam commented 5 years ago

Good evening from Spain. I'm afraid I don't know how to compile it... Let me see if I can find out how to do it. As soon as I' ve tested it I'll let you know. Thank you so much Delubear. Regards

Delubear commented 5 years ago

@JimZam please see this URL for a compiled version: https://github.com/Delubear/GlucoseTray/releases/tag/1.1

JimZam commented 5 years ago

Thank you so much.

JimZam commented 5 years ago

Good morning. I'm afraid it doesn't work. If you make any change I'll try it. Thank you Christopher Have a great weekend

Delubear commented 5 years ago

@JimZam I've found a way to get this data directly from DexCom using the same methods Nightscout uses. I got the proof of concept down and will be working to implement it and will update this once I have it published and the new release binaries out for you to try.

Delubear commented 5 years ago

@JimZam Please see this release https://github.com/Delubear/GlucoseTray/releases/tag/2.0

No longer goes through nightscout or herokuapp to retrieve the real time data, instead it now goes directly to Dexcom like Nightscout does.

JimZam commented 5 years ago

I'm not in Dexcom site. I use G4 and xbridge with xdrip+... I'll register and try

Delubear commented 5 years ago

@JimZam I was finally able to configure my herokuapp site to have denied set for auth_default_roles. It required me to generate a token with the 'readable' role and put it into the new setting in the .exe.config for Token.

Please see this release and let me know if it fixes this for you now. https://github.com/Delubear/GlucoseTray/releases/tag/2.1

So, log into the admin section of your Herokuapp, create a new token and set the role to one that has access to read data, by default, 'readable' works. I've included a link to the documentation on this in the config file as well.

JimZam commented 5 years ago

Thank you, works great!!! Thanks again

Edit: it closes after a whille :-(

JimZam commented 5 years ago

Hello again. The application works but only for a few seconds, then it closes :-( Regards

Delubear commented 5 years ago

@JimZam Can you upload your error log? By default, the location is C:\TEMP\TrayError.txt

JimZam commented 5 years ago

Good evening. There is no error file. The app closes and that's all :-( Thank you

Delubear commented 5 years ago

Do you have a C:\Temp\ folder already? If not, can you create it? and also create the TrayError.txt file? Whatever matches your .exe.config. Then relaunch and see if that fixes it. If not, it should at least be logging correctly then.

Delubear commented 5 years ago

@JimZam

JimZam commented 5 years ago

In the past I got error messages when trying your previous releases but now the app shows my glucose from nightscout for a while and then closes, no error.txt at all...

Delubear commented 5 years ago

You'll need to create the log file if it doesnt' exist and isn't getting created. Otherwise I'm working on a small fix to at least get us guaranteed logging in error scenarios.

Delubear commented 5 years ago

@JimZam Try this release and make sure to delete your existing .config file and replace it with the new one.

https://github.com/Delubear/GlucoseTray/releases/tag/2.2

This should make sure it creates the errorlog.txt file or at least throw a popup with the error if needed.

JimZam commented 5 years ago

Hello again. It shwos error mesasges popups and .txt before I configured everything in .exe.config. Once all is fine it shows the glucose in the try for a while and closes without popups nor .txt, I'm sorry

Delubear commented 5 years ago

If you had it running and it created the .txt file originally. Can you upload it so I can see what it might have? Once the file already exists, everything should be going to it. @JimZam

Delubear commented 5 years ago

@JimZam I found one issue that may have been causing the logging process to crash as well, preventing the details being logged.

  1. Use this release: https://github.com/Delubear/GlucoseTray/releases/tag/2.3 and configure the .exe.config
  2. Open up Task Manager and end any GlucoseTray processes.
  3. Make sure the path and file C:\Temp\TrayError.txt exists on your machine before running.
  4. If it still crashes, upload the C:\Temp\TrayError.txt file to this thread.
JimZam commented 5 years ago

It happens with all the past versions too, even without AUTH_DEFAULT_ROLES denied. I'm going to try version 2.3 Thanks

JimZam commented 5 years ago

No way, it dissappears from the tray after a few sedonds. If it works for you it is my Windows doing something strange... error.txt is empty Thank you for all the effords

Delubear commented 5 years ago

Unfortunately, only other way to track down the error if it's an application issue would be to have you install Visual Studio Community and debug the application to see what errors it throws for you.

Also be sure that Windows isn't just hiding it from the Taskbar and putting it with the rest of the icons. I would be curious to see if it runs on other computers with your same config settings without issues as well.

Delubear commented 5 years ago

@JimZam I have updated the project to .net core which should now run independently of any .net framework installs on your machine which may help compatibility. I will set a reminder to upload the binaries and ping you once they're ready for download.

Delubear commented 5 years ago

@JimZam Please try this release to see if it fixes any issues you may have been having with the .Net Framework on your machine. This is a single file self-contained .net core release which won't depend on any frameworks being installed on your machine.

https://github.com/Delubear/GlucoseTray/releases/tag/3.0

JimZam commented 5 years ago

Hello. Yes, it works, but it is not reading my Nightscout URl nor token, it is reading your Dexcom account (168). I can see your user and password un the error file... Thank you so much for sharing your work Kind regards

Evelio


From: Christopher Baker notifications@github.com Sent: Wednesday, July 10, 2019 3:30:15 PM To: Delubear/GlucoseTray Cc: JimZam; Mention Subject: Re: [Delubear/GlucoseTray] Not working if herokuapp requires api secret (#8)

@JimZamhttps://github.com/JimZam Please try this release to see if it fixes any issues you may have been having with the .Net Framework on your machine. This is a single file self-contained .net core release which won't depend on any frameworks being installed on your machine.

https://github.com/Delubear/GlucoseTray/releases/tag/3.0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Delubear/GlucoseTray/issues/8?email_source=notifications&email_token=AFR5J2WFWFSRPLKPKXMSZMDP6XP6PA5CNFSM4HXZ2KA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZTOXNI#issuecomment-510061493, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFR5J2TDTOUH7ESYAR3FSZDP6XP6PANCNFSM4HXZ2KAQ.

Delubear commented 5 years ago

Try this: https://github.com/Delubear/GlucoseTray/releases/tag/3.0 Fixed a lot more with reading configs now. @JimZam

Delubear commented 5 years ago

The 3.0 Release has been updated to address this issue. You will notice after running the program once, a new file created, .exe.config file. If you need to make any changes, for now I would recommend deleting the .exe.config file and putting your updates in the .dll.config file. Have a task added to make this process better.

@JimZam

JimZam commented 5 years ago

It works without with AUTH disabled, I get this error when enabled and with token: "Nightscout fetching failed or received incorrect format."

Delubear commented 5 years ago

I'm re-adding a Nightscout site and will test this.

Delubear commented 5 years ago

@JimZam Here is the release that should fix all the issues.

https://github.com/Delubear/GlucoseTray/releases/tag/4.0

Configure the appsettings.json file with your settings.

Fixed an issue where I wasn't passing the access token as well.

JimZam commented 5 years ago

Good morning. Works great!!! Thank you again Delubear Regards