jamesread / prometheus-gmail-exporter

Checks gmail labels for unread messages and exposes the counts via prometheus.
Apache License 2.0
47 stars 9 forks source link

Error 400: redirect_uri_mismatch #10

Closed vorburger closed 1 year ago

vorburger commented 1 year ago

I'm attempting the follow https://github.com/jamesread/prometheus-gmail-exporter#getting-client_secretsjson (as-is right now) but so far fail to be able to get this to work...

The problem I'm (now) facing is:

_Access blocked: This app’s request is invalid. You can’t sign in because this app sent an invalid request. You can try again later, or contact the developer about this issue. Learn more about this error. If you are a developer of this app, see error details: Request details: redirect_uri=http://example.com:50879/ Error 400: redirect_urimismatch

The README is missing a note about having to set an Authorized redirect URI when creating the OAuth 2.0 Client ID - but that (alone) doesn't help, the fun part is that the port of http://example.com:33657 it uses on the redirect_uri keeps changing... 🤣

@jamesread just wanted to record this here for other future users; I'll try out the (quote #8) port of the python version to do "online auth", rather than the "offline auth" branch next.

vorburger commented 1 year ago

the port of http://example.com:33657 it uses on the redirect_uri keeps changing...

This actually looks like it may be trivial to fix... and the easiest short term first next step, for me?

I'll something out, and contrib a PR if I manage!

jamesread commented 1 year ago

Ohh, okay, yep this looks like a security option added into Google's OAuth after I first developed this project. I've always used offline auth up until now as well, so I hadn't noticed it.

Let's use port 9090 as the default for now - I'll accept that PR.