sterrenb / flutterhole

A third party Android application for the Pi-Hole® dashboard.
https://play.google.com/store/apps/details?id=sterrenburg.github.flutterhole
MIT License
400 stars 27 forks source link

Authentication error #77

Closed Gorillab1scuit closed 4 years ago

Gorillab1scuit commented 4 years ago

I'm getting an authentication error even though I'm authenticated with API. The Query total and blacklist data is there.

Screenshot_20200516-004645

sterrenb commented 4 years ago

Hello @Gorillab1scuit 👋 - Thanks for opening an issue!

Could you check the API Log and look for requests that provide a Query Parameter called auth? This information can be found by clicking an entry, then navigating to the 'Request' tab. The value of the auth parameter should be the plaintext API token that you scanned from your Pi-hole.

Alternatively, try going to this URL in a browser with your own credentials:

{{ base_url }}?topItems&auth={{ auth }}

Does this yield a JSON response with some data, or an empty response looking like []?

Gorillab1scuit commented 4 years ago

There are no auth references in the few API logs in flutterhole. I can navigate to the webpage successfully with the URL provided, and the response is a total queries over 24 graph.

On Sat, May 16, 2020, 04:15 Thomas notifications@github.com wrote:

Hello @Gorillab1scuit https://github.com/Gorillab1scuit 👋 - Thanks for opening an issue!

Could you check the API Log and look for requests that provide a Query Parameter called auth? This information can be found by clicking an entry, then navigating to the 'Request' tab. The value of the auth parameter should be the plaintext API token that you scanned from your Pi-hole.

Alternatively, try going to this URL in a browser with your own credentials:

{{ base_url }}?topItems&auth={{ auth }}

Does this yield a JSON response with some data, or an empty response looking like []?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sterrenburg/flutterhole/issues/77#issuecomment-629607750, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIZORSZRO7NML3AVCST6UHDRRZDRFANCNFSM4NCYAAEA .

sutch commented 4 years ago

I am experiencing the same issue.

Could you check the API Log and look for requests that provide a Query Parameter called auth? This information can be found by clicking an entry, then navigating to the 'Request' tab. The value of the auth parameter should be the plaintext API token that you scanned from your Pi-hole.

No requests contain an auth parameter. The parameters are empty or contain parameters named status, summaryRaw, or overTimeData10mins.

Alternatively, try going to this URL in a browser with your own credentials:

{{ base_url }}?topItems&auth={{ auth }}

Does this yield a JSON response with some data, or an empty response looking like []?

This returns a JSON response containing top_queries and top_ads, each containing 10 entries.

gorillap commented 4 years ago

This is likely related to the recent 5.0 update. Mine did the same thing.

Try clearing the apps storage/data, Reconfigure your pihole. Try using the IP address instead of URL if you have an issue, i.e. http://192.168.1.xxx I did this and got basic functionality/stats showing but live query log is still not working

sterrenb commented 4 years ago

I've heard of more people needing to clear their storage/cache after updating from the 2.x version, so that might be a good fallback attempt to fix the issue.

The 5.x version of the app is basically a new package under the same name. Perhaps this leads to some kinks wrt the app's OS permissions.

On the Pihole form page, do you guys see your API token in the field after saving and reloading? Perhaps the form data isn't properly saved.

sutch commented 4 years ago

I cleared storage for flutterhole, re-scanned the API token from Pi-hole, and the problem is now resolved. Thank you for the suggestion.

Initially after updating to the 5.x version of the app, the API token was missing and I had to re-scan the API token from Pi-hole. This did not fix the issue. Clearing the storage and then adding the token was what worked for me.

Gorillab1scuit commented 4 years ago

no change for me, unfortunately. I couldn't remove my old pihole. Had to reboot, then the config was gone. Set it back up and still not authenticated for the bottom 2 graphs on the dashboard.

Gorillab1scuit commented 4 years ago

OK, I deleted the config for my pi-hole. It left Pi-hole #0. I added the API config and BOOM it works.