Can not login sign in to Grafana using auth.google

I followed Grafana auth.google and I am to login.
Case1: Able to Login to Grafana using different mail id’s (in system where I have installed grafana and configured everything).(Installed in System A with IP:192.168.xxx.A)
Case 2: I have accessed my grafana(192.168.xxx.A:3000) in System B
with admin:admin credentials I am able to login . At the same time when I tried to login using sign in with google option I get error as

Unable to connect

Firefox can’t establish a connection to the server at localhost:3000.

    The site could be temporarily unavailable or too busy. Try again in a few moments.
    If you are unable to load any pages, check your computer’s network connection.
    If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.

This is what I configured in my default.ini file

[auth.google]
enabled = true
allow_sign_up = true
client_id = my_client_ID
client_secret = MyClient_Secreat
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
api_url = https://www.googleapis.com/oauth2/v1/userinfo
allow_sign_up = true
hosted_domain =

Can any one help on this issue??

I got the issue that is while creating the client I specified localhost at Authorized Javascript Origins: filed and Authorized Redirect URLs field.
Thats why I was getting the error.
Currently I don’t have any domain. while creating the client I cannot use http://192.168.x.x:3000/login/google in Authorized Redirect URLs field. Any work around for this??

You have to use Google oauth with the domain. Buy/use own domain or define host record with your current Grafana local IP in your local hosts file.

1 Like