Grafana with Google oauth

Hey Everyone!

I want to set up Google oauth (exactly like it is in the official documentation Configure Google OAuth2 authentication | Grafana documentation ). Here is how my grafana.ini looks like:

grafana.ini: |
    [analytics]
    check_for_updates = true
    [grafana_net]
    url = https://grafana.net
    [log]
    mode = console
    [paths]
    data = /var/lib/grafana/
    logs = /var/log/grafana
    plugins = /var/lib/grafana/plugins
    provisioning = /etc/grafana/provisioning
    [server]
    domain = monitoring.xenoss.io
    [auth.google]
    enabled = true
    client_id = XXXXXXXXXXXXXXXXXX
    client_secret = XXXXXXXXXXXXXXXXXXX
    scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
    auth_url = https://accounts.google.com/o/oauth2/auth
    token_url = https://accounts.google.com/o/oauth2/token
    allow_sign_up = true
    hosted_domain = xenoss.io

And here is what I set up inside OAuth 2.0 Client IDs:

And then I get this error when trying to authenticate with Google Oauth in Grafana:
redirect_uri=https://monitor.xenoss.io:3000/login/google

Maybe it is because it tries to use port 3000, however even when I explicitly use 443 or 80 it still uses 3000 port, I’m not sure that this causing a problem, but it is the only thing I can think about

Please configure root_url properly.

Hello!

It seems like you’ve configured Google OAuth in Grafana, but the issue you’re encountering with the redirect URI can be resolved. Make sure that the redirect URI in your Google OAuth client settings matches the one configured in Grafana, including the correct port (e.g., https://monitor.xenoss.io:3000/login/google).

Additionally, ensure that the Grafana server is running on the expected port (3000 in this case) and that there are no conflicts or proxies interfering with the redirect.

If the issue persists, consider double-checking the Grafana documentation for any additional configuration steps or Vermögen troubleshooting tips specific to your setup. Good luck with your OAuth integration!